diff --git a/query_match_none.go b/query_match_none.go index 9b4ea8ae..b13ca6c8 100644 --- a/query_match_none.go +++ b/query_match_none.go @@ -10,6 +10,8 @@ package bleve import ( + "encoding/json" + "github.com/blevesearch/bleve/index" "github.com/blevesearch/bleve/search" "github.com/blevesearch/bleve/search/searchers" @@ -51,3 +53,11 @@ func (q *matchNoneQuery) Field() string { func (q *matchNoneQuery) SetField(f string) Query { return q } + +func (q *matchNoneQuery) MarshalJSON() ([]byte, error) { + tmp := map[string]interface{}{ + "boost": q.BoostVal, + "match_none": map[string]interface{}{}, + } + return json.Marshal(tmp) +}