Skip to content

inconsistency between source filtering names in query parameter vs request body #22792

@djschny

Description

@djschny

Elasticsearch version: 5.1.1

Plugins installed: []

JVM version: 1.8.0_92-b14

OS version: Mac 10.12.2

Description of the problem including expected versus actual behavior:
In regards to source filtering and using include/exclude it appears @pickypg and I observed two discrepancies:

  • _source_include in singular or plural form when used as a query parameter works fine, however when the singular form is used in the request body, an error is thrown and a plural version is required to be used.
  • the error that does come back is a deprecated field response as opposed to executing the request and the deprecation coming back as a header

As a side note Console in Kibana is auto suggesting the singular version as well and will enter an issue there for that as well.

Steps to reproduce:

# Request - successful as query parameter with either singular or plural version
GET nutrition/_search?_source_includes=calories
# Request - throws error as request body
GET nutrition/_search
{
  "_source": {
    "include": "calories"
  }
}

# Response
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Deprecated field [include] used, expected [includes] instead"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Deprecated field [include] used, expected [includes] instead"
  },
  "status": 400
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions