org.apache.solr.handler.component

Interface MergeStrategy

  • All Known Implementing Classes:
    IterativeMergeStrategy


    public interface MergeStrategy
    The MergeStrategy class defines custom merge logic for distributed searches. Note: This API is experimental and may change in non backward-compatible ways in the future
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      int getCost()
      Defines the order that the mergeStrategies are applied.
      void handleMergeFields(ResponseBuilder rb, SolrIndexSearcher searcher)
      Implement handleMergeFields(ResponseBuilder rb, SolrIndexSearch searcher) if your merge strategy needs more complex data then the sort fields provide.
      boolean handlesMergeFields()
      handlesMergeFields must return true if the MergeStrategy implements a custom handleMergeFields(ResponseBuilder rb, SolrIndexSearch searcher)
      void merge(ResponseBuilder rb, ShardRequest sreq)
      merge defines the merging behaving of results that are collected from the shards during a distributed search.
      boolean mergesIds()
      mergesIds must return true if the merge method merges document ids from the shards.
    • Method Detail

      • merge

        void merge(ResponseBuilder rb,
                   ShardRequest sreq)
        merge defines the merging behaving of results that are collected from the shards during a distributed search.
      • mergesIds

        boolean mergesIds()
        mergesIds must return true if the merge method merges document ids from the shards. If it merges other output from the shards it must return false.
      • handlesMergeFields

        boolean handlesMergeFields()
        handlesMergeFields must return true if the MergeStrategy implements a custom handleMergeFields(ResponseBuilder rb, SolrIndexSearch searcher)
      • getCost

        int getCost()
        Defines the order that the mergeStrategies are applied. Lower costs are applied first.