Class StartsWithOpenSearchSearchStrategy
java.lang.Object
io.jmix.search.searching.impl.AbstractSearchStrategy<org.opensearch.client.opensearch.core.SearchRequest.Builder,OpenSearchQueryConfigurer>
io.jmix.searchopensearch.searching.strategy.impl.AbstractOpenSearchStrategy
io.jmix.searchopensearch.searching.strategy.impl.StartsWithOpenSearchSearchStrategy
- All Implemented Interfaces:
SearchStrategy<org.opensearch.client.opensearch.core.SearchRequest.Builder>,OpenSearchSearchStrategy
@Component("search_StartsWithOpenSearchSearchStrategy")
public class StartsWithOpenSearchSearchStrategy
extends AbstractOpenSearchStrategy
Class that encapsulates logic of
SearchStrategy that searches documents by prefix.-
Field Summary
FieldsFields inherited from class io.jmix.search.searching.impl.AbstractSearchStrategy
queryConfigurer -
Constructor Summary
ConstructorsConstructorDescriptionStartsWithOpenSearchSearchStrategy(OpenSearchQueryConfigurer queryConfigurator, SearchProperties searchProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureRequest(SearchRequestContext<org.opensearch.client.opensearch.core.SearchRequest.Builder> requestContext) Configures the provided search request context based on the current search strategy.protected voidconfigureTermsQuery(SearchRequestContext<org.opensearch.client.opensearch.core.SearchRequest.Builder> requestContext) protected voidconfigureWildcardQuery(SearchRequestContext<org.opensearch.client.opensearch.core.SearchRequest.Builder> requestContext) getName()Provides the name of this search strategy.protected booleanisSearchTermExceedMaxPrefixSize(String searchText, int maxPrefixSize) Methods inherited from class io.jmix.searchopensearch.searching.strategy.impl.AbstractOpenSearchStrategy
configureRequestMethods inherited from class io.jmix.search.searching.impl.AbstractSearchStrategy
toString
-
Field Details
-
searchProperties
-
-
Constructor Details
-
StartsWithOpenSearchSearchStrategy
public StartsWithOpenSearchSearchStrategy(OpenSearchQueryConfigurer queryConfigurator, SearchProperties searchProperties)
-
-
Method Details
-
getName
Description copied from interface:SearchStrategyProvides the name of this search strategy. Name should be unique among all search strategies in application.- Returns:
- name
-
configureRequest
public void configureRequest(SearchRequestContext<org.opensearch.client.opensearch.core.SearchRequest.Builder> requestContext) Description copied from interface:SearchStrategyConfigures the provided search request context based on the current search strategy.- Parameters:
requestContext- theSearchRequestContextto configure, which provides the necessary metadata and state of the search preparation process. The type parameterTrepresents the platform-specific request builder associated with the context.
-
configureTermsQuery
protected void configureTermsQuery(SearchRequestContext<org.opensearch.client.opensearch.core.SearchRequest.Builder> requestContext) -
configureWildcardQuery
protected void configureWildcardQuery(SearchRequestContext<org.opensearch.client.opensearch.core.SearchRequest.Builder> requestContext) -
isSearchTermExceedMaxPrefixSize
-