Class IndexRouting.ExtractFromSource

java.lang.Object
org.elasticsearch.cluster.routing.IndexRouting
org.elasticsearch.cluster.routing.IndexRouting.ExtractFromSource
Enclosing class:
IndexRouting

public static class IndexRouting.ExtractFromSource extends IndexRouting
  • Method Details

    • process

      public void process(IndexRequest indexRequest)
      Specified by:
      process in class IndexRouting
    • indexShard

      public int indexShard(String id, @Nullable String routing, org.elasticsearch.xcontent.XContentType sourceType, BytesReference source)
      Description copied from class: IndexRouting
      Called when indexing a document to generate the shard id that should contain a document with the provided parameters.
      Specified by:
      indexShard in class IndexRouting
    • createId

      public String createId(org.elasticsearch.xcontent.XContentType sourceType, BytesReference source, byte[] suffix)
    • createId

      public String createId(Map<String,Object> flat, byte[] suffix)
    • updateShard

      public int updateShard(String id, @Nullable String routing)
      Description copied from class: IndexRouting
      Called when updating a document to generate the shard id that should contain a document with the provided _id and (optional) _routing.
      Specified by:
      updateShard in class IndexRouting
    • deleteShard

      public int deleteShard(String id, @Nullable String routing)
      Description copied from class: IndexRouting
      Called when deleting a document to generate the shard id that should contain a document with the provided _id and (optional) _routing.
      Specified by:
      deleteShard in class IndexRouting
    • getShard

      public int getShard(String id, @Nullable String routing)
      Description copied from class: IndexRouting
      Called when getting a document to generate the shard id that should contain a document with the provided _id and (optional) _routing.
      Specified by:
      getShard in class IndexRouting
    • checkIndexSplitAllowed

      public void checkIndexSplitAllowed()
      Description copied from class: IndexRouting
      Check if the _split index operation is allowed for an index
      Overrides:
      checkIndexSplitAllowed in class IndexRouting
    • collectSearchShards

      public void collectSearchShards(String routing, IntConsumer consumer)
      Description copied from class: IndexRouting
      Collect all of the shard ids that *may* contain documents with the provided routing. Indices with a routing_partition will collect more than one shard. Indices without a partition will collect the same shard id as would be returned by IndexRouting.getShard(java.lang.String, java.lang.String).

      Note: This is called for any search-like requests that have a routing specified but only if they have a routing specified. If they do not have a routing they just use all shards in the index.

      Specified by:
      collectSearchShards in class IndexRouting