elastic / elasticsearch-php

Official PHP client for Elasticsearch.
https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html
MIT License
35 stars 970 forks source link

Search endpoint parameter whitelist should allow _source_include and _source_exclude #962

Closed sauerbraten closed 5 years ago

sauerbraten commented 5 years ago

Summary of problem or feature request

The Search endpoint parameter whitelist should allow _source_include and _source_exclude as documented: https://github.com/elastic/elasticsearch-php/blob/master/docs/build/Elasticsearch/Client.asciidoc#Elasticsearch_Clientsearch_search.

Right now, it only allows _source_includes (note the S at the end) and _source_excludes: https://github.com/elastic/elasticsearch-php/blob/f8b5d2beeeb22a5a59aabb183b5bcd7e70878d2f/src/Elasticsearch/Endpoints/Search.php#L72

The Get endpoint parameter whitelist already contains both versions: https://github.com/elastic/elasticsearch-php/blob/f8b5d2beeeb22a5a59aabb183b5bcd7e70878d2f/src/Elasticsearch/Endpoints/Get.php#L52

ezimuel commented 5 years ago

@sauerbraten which version of Elasticsearch are you using? The _source_include and _source_exclude parameter has been change in favor of _source_includes and _source_excludes since Elasticsearch 6.6.0 (here you can see the API specification change).

The document that you pointed out is outdated, I need to fix it. Thanks for reporting it!

sauerbraten commented 5 years ago

I'm using Elasticsearch 7, but was looking at https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/ElasticsearchPHP_Endpoints.html#Elasticsearch_Clientsearch_search and https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/ElasticsearchPHP_Endpoints.html#Elasticsearch_Clientget_get which both list only the deprecated variants, so I assumed it was the other way around, and 'includes' and 'excludes' were old and 'include' and 'exclude' were new.

Thanks for taking care of the docs!