Skip to content

15.4.1 breaking change - unrecognized parameter: _sourceInclude, _sourceExclude #765

Closed
@onehorsetown

Description

@onehorsetown

Not an issue, just a heads up to others that might search for this error.

[illegal_argument_exception] request [...] contains unrecognized parameter: [_sourceInclude] -> did you mean any of [_source_include, _source_includes, _source_exclude, _source_excludes]
[illegal_argument_exception] request [...] contains unrecognized parameters: [_sourceExclude] -> did you mean any of [_source_exclude, _source_excludes, _source_include, _source_includes]?, [_sourceInclude] -> did you mean any of [_source_include, _source_includes, _source_exclude, _source_excludes]?

Upon upgrading to version 15.4.1, my code broke because the breaking change documented here:

https://www.elastic.co/guide/en/elasticsearch/reference/6.6/breaking-changes-6.6.html

Since the TypeScript types (https://www.npmjs.com/package/@types/elasticsearch) have not been updated to support the renamed properties, the easiest solution to explicitly set the apiVersion when constructing the Elasticsearch Client object:

new Client({  apiVersion: '6.5', ... }

otherwise the library will use client version 6.6 and your existing code will break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions