Class RoutingHashBuilder

java.lang.Object
org.elasticsearch.cluster.routing.RoutingHashBuilder

public class RoutingHashBuilder extends Object
A builder for computing a hash from fields in the document source that are part of the IndexMetadata.INDEX_ROUTING_PATH. It is used in the context of IndexRouting.ExtractFromSource.ForRoutingPath to determine the shard a document should be routed to.
  • Constructor Details

    • RoutingHashBuilder

      public RoutingHashBuilder(Predicate<String> isRoutingPath)
  • Method Details

    • addMatching

      public void addMatching(String fieldName, org.apache.lucene.util.BytesRef string)
    • createId

      public String createId(byte[] suffix, IntSupplier onEmpty)
      Only expected to be called for old indices created before IndexVersions.TIME_SERIES_ROUTING_HASH_IN_ID while creating (during ingestion) or synthesizing (at query time) the _id field.