Package org.elasticsearch.search
Class NestedUtils
java.lang.Object
org.elasticsearch.search.NestedUtils
Utility methods for dealing with nested mappers
-
Method Summary
Modifier and TypeMethodDescriptionpartitionByChildren
(String scope, List<String> children, List<T> inputs, Function<T, String> pathFunction) Partition a set of input objects by the children of a specific nested scope The returned map will contain an entry for all children, even if some of them are empty in the inputs.
-
Method Details
-
partitionByChildren
public static <T> Map<String,List<T>> partitionByChildren(String scope, List<String> children, List<T> inputs, Function<T, String> pathFunction) Partition a set of input objects by the children of a specific nested scope The returned map will contain an entry for all children, even if some of them are empty in the inputs. All children, and all input paths, must begin with the scope. Both children and inputs should be in sorted order.- Type Parameters:
T
- the type of the inputs- Parameters:
scope
- the nested scope to base partitions onchildren
- the immediate children of the nested scopeinputs
- a set of inputs to partitionpathFunction
- a function to retrieve a path for each input- Returns:
- a map of nested paths to lists of inputs
-