Package org.codelibs.fess.query
Class WildcardQueryCommand
java.lang.Object
org.codelibs.fess.query.QueryCommand
org.codelibs.fess.query.WildcardQueryCommand
Query command for handling wildcard queries.
Converts Lucene WildcardQuery objects to OpenSearch QueryBuilder objects,
supporting wildcard pattern matching with configurable case sensitivity.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.codelibs.fess.query.QueryCommand
QueryCommand.DefaultQueryBuilderFunction, QueryCommand.FieldQueryBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFlag indicating whether wildcard terms should be converted to lowercase. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.opensearch.index.query.QueryBuilderconvertWildcardQuery(QueryContext context, org.apache.lucene.search.WildcardQuery wildcardQuery, float boost) Converts a wildcard query to an appropriate OpenSearch QueryBuilder.org.opensearch.index.query.QueryBuilderexecute(QueryContext context, org.apache.lucene.search.Query query, float boost) Executes the query command and returns a QueryBuilder.protected StringGets the class name of the query this command handles.voidsetLowercaseWildcard(boolean lowercaseWildcard) Sets whether wildcard terms should be converted to lowercase.protected StringtoLowercaseWildcard(String value) Converts a wildcard value to lowercase if configured to do so.Methods inherited from class org.codelibs.fess.query.QueryCommand
buildDefaultQueryBuilder, buildMatchPhraseQuery, convertWithFieldCheck, createDefaultQueryBuilder, createFieldSortBuilder, getQueryFieldConfig, getQueryLanguages, getQueryProcessor, getSearchField, isSearchField, register
-
Field Details
-
lowercaseWildcard
protected boolean lowercaseWildcardFlag indicating whether wildcard terms should be converted to lowercase.
-
-
Constructor Details
-
WildcardQueryCommand
public WildcardQueryCommand()Default constructor.
-
-
Method Details
-
getQueryClassName
Description copied from class:QueryCommandGets the class name of the query this command handles.- Specified by:
getQueryClassNamein classQueryCommand- Returns:
- The query class name.
-
execute
public org.opensearch.index.query.QueryBuilder execute(QueryContext context, org.apache.lucene.search.Query query, float boost) Description copied from class:QueryCommandExecutes the query command and returns a QueryBuilder.- Specified by:
executein classQueryCommand- Parameters:
context- The query context containing search parameters.query- The Lucene query to execute.boost- The boost factor to apply.- Returns:
- The executed QueryBuilder.
-
convertWildcardQuery
protected org.opensearch.index.query.QueryBuilder convertWildcardQuery(QueryContext context, org.apache.lucene.search.WildcardQuery wildcardQuery, float boost) Converts a wildcard query to an appropriate OpenSearch QueryBuilder.- Parameters:
context- The query context containing field and search informationwildcardQuery- The Lucene wildcard query to convertboost- The boost factor to apply to the query- Returns:
- The converted OpenSearch QueryBuilder
-
toLowercaseWildcard
Converts a wildcard value to lowercase if configured to do so.- Parameters:
value- The wildcard value to potentially convert- Returns:
- The value in lowercase if lowercaseWildcard is true, otherwise the original value
-
setLowercaseWildcard
public void setLowercaseWildcard(boolean lowercaseWildcard) Sets whether wildcard terms should be converted to lowercase.- Parameters:
lowercaseWildcard- True to convert wildcard terms to lowercase, false otherwise
-