@@ -82,15 +82,15 @@ consumption. The default for the `human` flag is
8282`false`.
8383
8484[float]
85- === Response filtering
85+ === Response Filtering
8686
87- All REST APIs accept a `_path ` parameter that can be used to reduce
87+ All REST APIs accept a `filter_path ` parameter that can be used to reduce
8888the response returned by elasticsearch. This parameter takes a comma
8989separated list of filters expressed with the dot notation:
9090
9191[source,sh]
9292--------------------------------------------------
93- curl -XGET 'localhost:9200/_search?pretty&_path =took,hits.hits._id,hits.hits._score'
93+ curl -XGET 'localhost:9200/_search?pretty&filter_path =took,hits.hits._id,hits.hits._score'
9494{
9595 "took" : 3,
9696 "hits" : {
@@ -113,7 +113,7 @@ of a field's name:
113113
114114[source,sh]
115115--------------------------------------------------
116- curl -XGET 'localhost:9200/_nodes/stats?_path =nodes.*.ho*'
116+ curl -XGET 'localhost:9200/_nodes/stats?filter_path =nodes.*.ho*'
117117{
118118 "nodes" : {
119119 "lvJHed8uQQu4brS-SXKsNA" : {
@@ -123,13 +123,13 @@ curl -XGET 'localhost:9200/_nodes/stats?_path=nodes.*.ho*'
123123}
124124--------------------------------------------------
125125
126- And the `**` wildcard can used to include fields without knowing the
126+ And the `**` wildcard can be used to include fields without knowing the
127127exact path of the field. For example, we can return the Lucene version
128128of every segment with this request:
129129
130130[source,sh]
131131--------------------------------------------------
132- curl 'localhost:9200/_segments?pretty&_path =indices.**.version'
132+ curl 'localhost:9200/_segments?pretty&filter_path =indices.**.version'
133133{
134134 "indices" : {
135135 "movies" : {
@@ -166,9 +166,26 @@ curl 'localhost:9200/_segments?pretty&_path=indices.**.version'
166166--------------------------------------------------
167167
168168Note that elasticsearch sometimes returns directly the raw value of a field,
169- like the `_source` field. If you want to filter the response that include
170- _source fields, you should consider using the already existing `_source`
171- parameter (see <<get-source-filtering,Get API>> for more details).
169+ like the `_source` field. If you want to filter _source fields, you should
170+ consider combining the already existing `_source` parameter (see
171+ <<get-source-filtering,Get API>> for more details) with the `filter_path`
172+ parameter like this:
173+
174+ [source,sh]
175+ --------------------------------------------------
176+ curl -XGET 'localhost:9200/_search?pretty&filter_path=hits.hits._source&_source=title'
177+ {
178+ "hits" : {
179+ "hits" : [ {
180+ "_source":{"title":"Book #2"}
181+ }, {
182+ "_source":{"title":"Book #1"}
183+ }, {
184+ "_source":{"title":"Book #3"}
185+ } ]
186+ }
187+ }
188+ --------------------------------------------------
172189
173190
174191[float]
0 commit comments