0
0

fix marshaling of MatchNone queries

This commit is contained in:
Marty Schoch 2016-04-16 20:51:27 -04:00
parent 95b03f9b54
commit c7ae842b33

View File

@ -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)
}