Enable_position_increment in query_string


(Shai Erera) #1

Hi, per the documentation here https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html, the property enable_position_increments is supposed to be defined in the query body, however when I send a request (on master) to an index I get:

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "[query_string] query does not support [enable_position_increments]",
        "line": 14,
        "col": 34
      }
    ],
    "type": "parsing_exception",
    "reason": "[query_string] query does not support [enable_position_increments]",
    "line": 14,
    "col": 34
  },
  "status": 400
}

QueryStringQueryBuilder defines the property as: private static final ParseField ENABLE_POSITION_INCREMENTS_FIELD = new ParseField("enable_position_increment"); (note, without the terminal 's')

So, is this a documentation issue, or a code issue? If I send the query without the terminal 's', it works, so seems like a documentation issue?


(Nik Everett) #2

I'll look into it. One moment.


(Nik Everett) #3

It looks like it was a typo was introduced in 5.0. I'll open a PR with a fix. For now use the name that works. I'll keep support for that name in the 5.x line of Elasticsearch and remove it in 6.0.


(Shai Erera) #4

Thanks @nik9000, I'll use enable_position_increment then.

I'll keep support for that name in the 5.x line of Elasticsearch and remove it in 6.0

What do you mean? It (enable_position_increments) doesn't seem to be supported at all, no?


(Nik Everett) #5

I'll add support for enable_position_increments and deprecate enable_position_increment. It'd be less work if I could just update the documentation but in this case the thing you are enabling is really called "position increments" not "position increment".


(Shai Erera) #6

Gotcha. Thanks!


(Nik Everett) #7

(system) #8

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