Elasticsearch: unknown search element [common]: Common Terms Query not working?

Created on 17 Nov 2015  路  4Comments  路  Source: elastic/elasticsearch

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?

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.

curl -XGET 'http://localhost:9201/INDEX_NAME/_search' -d '{"query": {"common": { "FIELD_NAME": {"query": "SEARCH_TERMS", "cutoff_frequency": 0.001 }}}}'

All 4 comments

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:

  • Grafana 4.3.2
  • ElasticSearch 2.3.3
  • Linux 64 bits #

It's not a bug. The search body is missing the query parameter

The query parameter is omitted in the online docs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthughes picture matthughes  路  3Comments

rpalsaxena picture rpalsaxena  路  3Comments

dawi picture dawi  路  3Comments

clintongormley picture clintongormley  路  3Comments

dadoonet picture dadoonet  路  3Comments