Skip to content

Commit

Permalink
fix marshaling of MatchAll queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoch committed Apr 7, 2016
1 parent 36170a4 commit 74b7872
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions query_match_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -51,3 +53,11 @@ func (q *matchAllQuery) Field() string {
func (q *matchAllQuery) SetField(f string) Query {
return q
}

func (q *matchAllQuery) MarshalJSON() ([]byte, error) {
tmp := map[string]interface{}{
"boost": q.BoostVal,
"match_all": map[string]interface{}{},
}
return json.Marshal(tmp)
}

0 comments on commit 74b7872

Please sign in to comment.