fix marshaling of MatchNone queries
This commit is contained in:
parent
95b03f9b54
commit
c7ae842b33
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user