diff --git a/search/query/query.go b/search/query/query.go index 7a4b0751..9e7a2e97 100644 --- a/search/query/query.go +++ b/search/query/query.go @@ -226,6 +226,15 @@ func ParseQuery(input []byte) (Query, error) { } return &rv, nil } + _, hasBool := tmp["bool"] + if hasBool { + var rv BoolFieldQuery + err := json.Unmarshal(input, &rv) + if err != nil { + return nil, err + } + return &rv, nil + } return nil, fmt.Errorf("unknown query type") } diff --git a/search/query/query_test.go b/search/query/query_test.go index 59e5ce60..09d25f14 100644 --- a/search/query/query_test.go +++ b/search/query/query_test.go @@ -170,6 +170,10 @@ func TestParseQuery(t *testing.T) { input: []byte(`{"ids":["a","b","c"]}`), output: NewDocIDQuery([]string{"a", "b", "c"}), }, + { + input: []byte(`{"bool": true}`), + output: NewBoolFieldQuery(true), + }, { input: []byte(`{"madeitup":"queryhere"}`), output: nil,