Class NestedUtils

java.lang.Object
org.elasticsearch.search.NestedUtils

public final class NestedUtils extends Object
Utility methods for dealing with nested mappers
  • 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 on
      children - the immediate children of the nested scope
      inputs - a set of inputs to partition
      pathFunction - a function to retrieve a path for each input
      Returns:
      a map of nested paths to lists of inputs