Query_string still returns results although _all field is disabled

Hello.

My environment is elasticsearch 5.3.0.

I am testing queries through kibana to see what happens if the _all field is disabled. To save memory space, I am thinking of disabling all field but result of query string was not the same as written in the document.

I have a indice which has _all field disabled as below.

{
  "indice1": {
    "mappings": {
      "type1": {
        "_all": {
          "enabled": false
        },
        "properties": {
          "text": {
            "type": "text"
          }
        }
      }
    }
  }
}

However, after I indexed document as below,

POST indice1/type1
{
  "text" : "渡辺" 
}

and do a query_string, I expect no hits but there is one.

GET indice1/type1/_search
{
  "query" : {
    "query_string" : {
      "query" : "渡辺"
    }
  }
}

Result

{
  "took": 9,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 0.51623213,
    "hits": [
      {
        "_index": "indice1",
        "_type": "type1",
        "_id": "AVstmBVkFzCqOmarGmV1",
        "_score": 0.51623213,
        "_source": {
          "text": "渡辺"
        }
      }
    ]
  }
}

Result is also shown on Kibana discovery as well.

I though there should be no hits. Am I understanding the query_string wrongly?

I know that this is expected for 6.0 version as we will remove _all field but will keep the feature of searching inside the document whichever field.

I don't know if this is supposed to work already in 5.3 though.

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