Wildcard query over _all field on Elasticsearch 5 failed


(Benjamin Dupré) #1

Hi the following query is not working anymore with ES 5.0 :

GET g_contents/_search
{
  "query": {
              "wildcard" : {
                "_all" : {
                  "wildcard" : "*doc*",
                  "boost": 1
                }
              }
            }
      }

Are they anyway to get the same result with ES 5?

Regards,
Benjamin Dupré


(David Pilato) #2

First of all, that's a very bad idea. It's one of the worse query you can send to elasticsearch.
Similar to a full scan table you have in SQL databases.

Can you tell what is the error message you are getting?


(Benjamin Dupré) #3

Hi David,
Yes i know that's a terrible for performance but it's limited to a small index size.

the error is :

{
  "error": {
    "root_cause": [
      {
        "type": "query_shard_exception",
        "reason": "failed to create query: {\n  \"wildcard\" : {\n    \"_all\" : {\n      \"wildcard\" : \"Keepin*\",\n      \"boost\" : 1.0\n    }\n  }\n}",
        "index_uuid": "ROGUdIGxRlOx-7EP8N0Xfw",
        "index": "g_contents"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "g_contents",
        "node": "YmywysnqRle3qc953VBvxg",
        "reason": {
          "type": "query_shard_exception",
          "reason": "failed to create query: {\n  \"wildcard\" : {\n    \"_all\" : {\n      \"wildcard\" : \"Keepin*\",\n      \"boost\" : 1.0\n    }\n  }\n}",
          "index_uuid": "ROGUdIGxRlOx-7EP8N0Xfw",
          "index": "g_contents",
          "caused_by": {
            "type": "illegal_argument_exception",
            "reason": "Cannot extract a term from a query of type class org.elasticsearch.common.lucene.all.AllTermQuery: _all:Keepin*"
          }
        }
      }
    ],
    "caused_by": {
      "type": "query_shard_exception",
      "reason": "failed to create query: {\n  \"wildcard\" : {\n    \"_all\" : {\n      \"wildcard\" : \"Keepin*\",\n      \"boost\" : 1.0\n    }\n  }\n}",
      "index_uuid": "ROGUdIGxRlOx-7EP8N0Xfw",
      "index": "g_contents",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "Cannot extract a term from a query of type class org.elasticsearch.common.lucene.all.AllTermQuery: _all:Keepin*"
      }
    }
  },
  "status": 400
}

(David Pilato) #4

I see and I can reproduce. I'm not sure if it's expected. @jpountz WDYT? Should we open an issue?


(Adrien Grand) #5

That looks like a bug indeed!


(David Pilato) #6

@Benjamin_Dupre could you open an issue with all the details you sent already and link to this thread?

Thanks!


(Benjamin Dupré) #7

Ok , i've opened the Issue


(system) #8

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.