-
Notifications
You must be signed in to change notification settings - Fork 632
Description
In our project we try to parse a search request with the typedAPI as follows
request, err := search.NewRequest().FromJSON(jsonstr) if err != nil { log.Errorf("failed to create request 1: " + err.Error()) return nil, err }
When we send a bool query with filter on terms, the terms part is being ignored. For example this query
{ "query": { "bool": { "filter": [ { "terms": { "Fields.lcf": [ "bifd", "xxx" ] } } ], "must": { "multi_match": { "query": "possibility", "fields": [ "Text", "Title^3" ] } } } } }
The resulting request does not hold the full terms section. It will be
terms: {}
Now if I change the input query as below it works, but this is obviously not a valid query to send to Elastic
{ "query": { "bool": { "filter": [ { "terms": { "TermsQuery": { "Fields.lcf": [ "bifd", "xxx" ] } } } ], "must": { "multi_match": { "query": "possibility", "fields": [ "Text", "Title^3" ] } } } } }
Am i missing something or is the API buggy here?
Thanks