|
@@ -33,3 +33,46 @@ the `_name` value). For example:
|
|
|
}
|
|
|
}
|
|
|
--------------------------------------------------
|
|
|
+
|
|
|
+[float]
|
|
|
+==== Join option
|
|
|
+
|
|
|
+The nested filter also supports an `join` option. Which controls whether to perform the block join.
|
|
|
+By default this enabled, but when disabled it emits the hidden nested documents as hits instead of the joined root document.
|
|
|
+
|
|
|
+This is useful when a `nested` filter is used in a facet where nested is enabled, like you can see in the example below:
|
|
|
+
|
|
|
+[source,js]
|
|
|
+--------------------------------------------------
|
|
|
+{
|
|
|
+ "query" : {
|
|
|
+ "nested" : {
|
|
|
+ "path" : "offers",
|
|
|
+ "query" : {
|
|
|
+ "match" : {
|
|
|
+ "offers.color" : "blue"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "facets" : {
|
|
|
+ "size" : {
|
|
|
+ "terms" : {
|
|
|
+ "field" : "offers.size"
|
|
|
+ },
|
|
|
+ "facet_filter" : {
|
|
|
+ "nested" : {
|
|
|
+ "path" : "offers",
|
|
|
+ "query" : {
|
|
|
+ "match" : {
|
|
|
+ "offers.color" : "blue"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "join" : false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "nested" : "offers"
|
|
|
+ }
|
|
|
+ }
|
|
|
+}'
|
|
|
+--------------------------------------------------
|