{"push_id":674977642,"size":1,"distinct_size":1,"ref":"refs/heads/1.x","head":"fce8d1f263d9a91ab56d725d40127c20d4c3fca3","before":"8052ca353a428f3fbeb86640446e6b17991df9f3","commits":[{"sha":"fce8d1f263d9a91ab56d725d40127c20d4c3fca3","author":{"email":"b8d3f9a31e790918c9363385aecaff2936991009@gmail.com","name":"Tanguy Leroux"},"message":"API: Add response filtering with filter_path parameter\n\nThis change adds a new \"filter_path\" parameter that can be used to filter and reduce the responses returned by the REST API of elasticsearch.\n\nFor example, returning only the shards that failed to be optimized:\n```\ncurl -XPOST 'localhost:9200/beer/_optimize?filter_path=_shards.failed'\n{\"_shards\":{\"failed\":0}}%\n```\n\nIt supports multiple filters (separated by a comma):\n```\ncurl -XGET 'localhost:9200/_mapping?pretty&filter_path=*.mappings.*.properties.name,*.mappings.*.properties.title'\n```\n\nIt also supports the YAML response format. Here it returns only the `_id` field of a newly indexed document:\n```\ncurl -XPOST 'localhost:9200/library/book?filter_path=_id' -d '---hello:\\n  world: 1\\n'\n---\n_id: \"AU0j64-b-stVfkvus5-A\"\n```\n\nIt also supports wildcards. Here it returns only the host name of every nodes in the cluster:\n```\ncurl -XGET 'http://localhost:9200/_nodes/stats?filter_path=nodes.*.host*'\n{\"nodes\":{\"lvJHed8uQQu4brS-SXKsNA\":{\"host\":\"portable\"}}}\n```\n\nAnd \"**\" can be used to include sub fields without knowing the exact path. Here it returns only the Lucene version of every segment:\n```\ncurl 'http://localhost:9200/_segments?pretty&filter_path=indices.**.version'\n{\n  \"indices\" : {\n    \"beer\" : {\n      \"shards\" : {\n        \"0\" : [ {\n          \"segments\" : {\n            \"_0\" : {\n              \"version\" : \"5.2.0\"\n            },\n            \"_1\" : {\n              \"version\" : \"5.2.0\"\n            }\n          }\n        } ]\n      }\n    }\n  }\n}\n```\n\nNote that elasticsearch sometimes returns directly the raw value of a field, like the _source field. If you want to filter _source fields, you should consider combining the already existing _source parameter (see Get API for more details) with the filter_path parameter like this:\n\n```\ncurl -XGET 'localhost:9200/_search?pretty&filter_path=hits.hits._source&_source=title'\n{\n  \"hits\" : {\n    \"hits\" : [ {\n      \"_source\":{\"title\":\"Book #2\"}\n    }, {\n      \"_source\":{\"title\":\"Book #1\"}\n    }, {\n      \"_source\":{\"title\":\"Book #3\"}\n    } ]\n  }\n}\n```","distinct":true,"url":"https://api.github.com/repos/NSIT/elasticsearch/commits/fce8d1f263d9a91ab56d725d40127c20d4c3fca3"}]}