Class RoutingPathFields

java.lang.Object
org.elasticsearch.index.mapper.RoutingPathFields
All Implemented Interfaces:
RoutingFields

public final class RoutingPathFields extends Object implements RoutingFields
Implementation of routing fields, using field matching based on the routing path content.
  • Constructor Details

  • Method Details

    • buildHash

      public BytesReference buildHash()
      Here we build the hash of the routing values using a similarity function so that we have a result with the following pattern: hash128(concatenate(routing field names)) + foreach(routing field value, limit = MAX_ROUTING_FIELDS) { hash32(routing field value) } + hash128(concatenate(routing field values)) The idea is to be able to place 'similar' values close to each other.
    • addString

      public RoutingFields addString(String fieldName, org.apache.lucene.util.BytesRef utf8Value)
      Description copied from interface: RoutingFields
      This overloaded method tries to take advantage of the fact that the UTF-8 value is already computed in some cases when we want to collect routing fields, so we can save re-computing the UTF-8 encoding.
      Specified by:
      addString in interface RoutingFields
    • addIp

      public RoutingFields addIp(String fieldName, InetAddress value)
      Specified by:
      addIp in interface RoutingFields
    • addLong

      public RoutingFields addLong(String fieldName, long value)
      Specified by:
      addLong in interface RoutingFields
    • addUnsignedLong

      public RoutingFields addUnsignedLong(String fieldName, long value)
      Specified by:
      addUnsignedLong in interface RoutingFields
    • addBoolean

      public RoutingFields addBoolean(String fieldName, boolean value)
      Specified by:
      addBoolean in interface RoutingFields
    • decodeAsMap

      public static Map<String,Object> decodeAsMap(org.apache.lucene.util.BytesRef bytesRef)