Class StartsWithOpenSearchSearchStrategy
java.lang.Object
io.jmix.search.searching.impl.AbstractSearchStrategy
io.jmix.searchopensearch.searching.strategy.impl.StartsWithOpenSearchSearchStrategy
- All Implemented Interfaces:
SearchStrategy,OpenSearchSearchStrategy
@Component("search_StartsWithOpenSearchSearchStrategy")
public class StartsWithOpenSearchSearchStrategy
extends AbstractSearchStrategy
implements OpenSearchSearchStrategy
Class that encapsulates logic of
SearchStrategy that searches documents by prefix.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IndexConfigurationManagerprotected final Metadataprotected final PolicyStoreprotected final SearchPropertiesprotected final SearchUtilsprotected final SecureOperations -
Constructor Summary
ConstructorsConstructorDescriptionStartsWithOpenSearchSearchStrategy(IndexConfigurationManager indexConfigurationManager, SearchProperties searchProperties, SecureOperations secureOperations, PolicyStore policyStore, Metadata metadata, SearchUtils searchUtils) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureRequest(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext) Configures OpenSearchSearchRequest.protected voidconfigureTermsQuery(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext) protected voidconfigureWildcardQuery(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext, Set<String> effectiveFieldsToSearch) getName()Provides the name of this search strategy.protected booleanisSearchTermExceedMaxPrefixSize(String searchText, int maxPrefixSize) Methods inherited from class io.jmix.search.searching.impl.AbstractSearchStrategy
toString
-
Field Details
-
indexConfigurationManager
-
searchProperties
-
secureOperations
-
policyStore
-
metadata
-
searchUtils
-
-
Constructor Details
-
StartsWithOpenSearchSearchStrategy
public StartsWithOpenSearchSearchStrategy(IndexConfigurationManager indexConfigurationManager, SearchProperties searchProperties, SecureOperations secureOperations, PolicyStore policyStore, Metadata metadata, SearchUtils searchUtils)
-
-
Method Details
-
getName
Description copied from interface:SearchStrategyProvides the name of this search strategy. Name should be unique among all search strategies in application.- Specified by:
getNamein interfaceSearchStrategy- Returns:
- name
-
configureRequest
public void configureRequest(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext) Description copied from interface:OpenSearchSearchStrategyConfigures OpenSearchSearchRequest.The main step - create appropriate query based on provided
SearchContextand 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:
configureRequestin interfaceOpenSearchSearchStrategy- Parameters:
requestBuilder- allows to configure search requestsearchContext- contains details about search being performed
-
configureTermsQuery
protected void configureTermsQuery(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext) -
configureWildcardQuery
protected void configureWildcardQuery(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext, Set<String> effectiveFieldsToSearch) -
isSearchTermExceedMaxPrefixSize
-