Enable_position_increment in query_string

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?

I'll look into it. One moment.

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.

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?

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".

Gotcha. Thanks!

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