I find myself unable to run a common terms query in the terms explained in the most recent documentation for v2.0.
Every time I try to run something along the lines of curl -XGET 'http://localhost:9201/INDEX_NAME/_search' -d '{"common": { "FIELD_NAME": {"query": "SEARCH_TERMS", "cutoff_frequency": 0.001 }}}', which pretty much replicates the examples in the docs, I encounter the following error:
{
"error": {
"root_cause": [ {
"type": "search_parse_exception",
"reason": "failed to parse search source. unknown search element [common]",
"line": 1,
"col": 2}],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [ {
"shard": 0,
"index":"INDEX_NAME",
"node": "b76-kVgxTWqwJTlBBba6xA",
"reason": {
"type": "search_parse_exception",
"reason": "failed to parse search source. unknown search element [common]",
"line": 1,
"col": 2
}
} ]
},
"status": 400
}%
Am I missing something or is ES saying that "common" searches are not recognized?
Questions like this are better asked on http://discuss.elastic.co.
Your query is malformed. The query must be under a "query" element.
curl -XGET 'http://localhost:9201/INDEX_NAME/_search' -d '{"query": {"common": { "FIELD_NAME": {"query": "SEARCH_TERMS", "cutoff_frequency": 0.001 }}}}'
The bug still happens.
I'm using:
It's not a bug. The search body is missing the query parameter
The query parameter is omitted in the online docs.
Most helpful comment
Questions like this are better asked on http://discuss.elastic.co.
Your query is malformed. The query must be under a "query" element.