javascript - elasticsearch Full Text Search all fields with start and end time -
i have following query runs, not return correct results. results returned not contain word requested in query(none contain word requested). may have "fields" part of query, shouldn't return nothing if nothing matches?
{ "fields": ["id", "author", "authorid"], "query": { "bool": { "must": [{ "match": { "content": "dog" } }], "filter": [{ "term": { "sourceoriginator": "twitter" } }, { "range": { "estimateddate": { "gte": "2016-07-24t18:14:36.000z", "lte": "2016-07-25t18:14:38.000z" } } }] } } }
the correct way use multi_match
{ "fields": ["id", "author", "authorid"], "query": { "bool": { "must": [{ "multi_match": { "query": "dog", "fields": ["id", "author", "authorid","content"] } }], "filter": [{ "term": { "sourceoriginator": "twitter" } }, { "range": { "estimateddate": { "gte": "2016-07-24t18:14:36.000z", "lte": "2016-07-25t18:14:38.000z" } } }] } } }
Comments
Post a Comment