Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
djschny opened this issue Jan 25, 2017 · 6 comments
Closed
Labels
>bug :Core/Infra/REST API REST infrastructure and utilities good first issue low hanging fruit help wanted adoptme

Comments

@djschny
Copy link
Contributor

djschny commented Jan 25, 2017

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
}
@clintongormley clintongormley added :Core/Infra/REST API REST infrastructure and utilities help wanted adoptme >bug good first issue low hanging fruit labels Jan 26, 2017
@pav-1
Copy link

pav-1 commented Feb 3, 2017

Hello, I'm looking for my first contribution to elasticsearch. I'll take it up.

I'm familiarizing myself with the code base.
So, hope it doesn't stop anyone else from coming up with a fix before I do!

@chaynika
Copy link

chaynika commented Mar 2, 2017

If this bug hasn't been fixed yet, I would like to work on it, starting today. Thank you!

@pav-1
Copy link

pav-1 commented Mar 2, 2017 via email

@pav-1
Copy link

pav-1 commented Mar 23, 2017

@djschny
This is not an issue anymore in 5.2.2 or master as ParseFieldMatcher is deprecated/removed and strict mode is not used when parsing includes.

Is this required in 5.1.x?

hesamemadi pushed a commit to hesamemadi/elasticsearch that referenced this issue Mar 24, 2017
…mes in the query parameters vs request body
kblincoe added a commit to kblincoe/elasticsearch that referenced this issue Apr 4, 2017
…consistency

Ticket elastic#22792, fixed inconsistency between query parameters vs request body
@pratikadola
Copy link

Has the issue been fixed?

@nik9000
Copy link
Member

nik9000 commented Mar 12, 2018

Has the issue been fixed?

It is still an issue. We'd want to deprecate the singular form in one PR which we'd merge to master and 6.x and then remove the singular form in a followup. These kinds of changes can be a bit tricky around the multi-version REST tests but the changes themselves are fairly simple.

nik9000 pushed a commit that referenced this issue Oct 29, 2018
)

Deprecates `_source_include` and `_source_exclude` url parameters
in favor of `_source_inclues` and `_source_excludes` because those
are consistent with the rest of Elasticsearch's APIs.

Relates to #22792
nik9000 pushed a commit that referenced this issue Oct 29, 2018
)

Deprecates `_source_include` and `_source_exclude` url parameters
in favor of `_source_inclues` and `_source_excludes` because those
are consistent with the rest of Elasticsearch's APIs.

Relates to #22792
kcm pushed a commit that referenced this issue Oct 30, 2018
)

Deprecates `_source_include` and `_source_exclude` url parameters
in favor of `_source_inclues` and `_source_excludes` because those
are consistent with the rest of Elasticsearch's APIs.

Relates to #22792
nik9000 pushed a commit that referenced this issue Oct 31, 2018
…de` (#35097)

Removes `_source_include` and `_source_exclude` url parameters. 
These parameters have been deprecated in #33475.

Closes #22792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/REST API REST infrastructure and utilities good first issue low hanging fruit help wanted adoptme
Projects
None yet
Development

No branches or pull requests

6 participants