Class PhraseElasticsearchSearchStrategy

java.lang.Object
io.jmix.search.searching.impl.AbstractSearchStrategy
io.jmix.searchelasticsearch.searching.strategy.impl.PhraseElasticsearchSearchStrategy
All Implemented Interfaces:
SearchStrategy, ElasticsearchSearchStrategy

@Component("search_PhraseElasticsearchSearchStrategy") public class PhraseElasticsearchSearchStrategy extends AbstractSearchStrategy implements ElasticsearchSearchStrategy
Describes SearchStrategy that searches documents with at least one field matches entire phrase - all input terms in provided order.
  • Constructor Details

    • PhraseElasticsearchSearchStrategy

      public PhraseElasticsearchSearchStrategy()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: SearchStrategy
      Provides the name of this search strategy. Name should be unique among all search strategies in application.
      Specified by:
      getName in interface SearchStrategy
      Returns:
      name
    • configureRequest

      public void configureRequest(co.elastic.clients.elasticsearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext)
      Description copied from interface: ElasticsearchSearchStrategy
      Configures Elasticsearch SearchRequest.

      The main step - create appropriate query based on provided SearchContext and set it to request.

      Configuration of another request parameters is optional.

      Highlighting, size and offset shouldn't be configured here - these parameters will be overwritten.

      Specified by:
      configureRequest in interface ElasticsearchSearchStrategy
      Parameters:
      requestBuilder - allows to configure search request
      searchContext - contains details about search being performed