Package org.codelibs.fess.query
Class TermQueryCommand
java.lang.Object
org.codelibs.fess.query.QueryCommand
org.codelibs.fess.query.TermQueryCommand
Command class for handling term query execution and conversion.
This class processes Lucene TermQuery objects and converts them to OpenSearch QueryBuilder instances.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.codelibs.fess.query.QueryCommand
QueryCommand.DefaultQueryBuilderFunction, QueryCommand.FieldQueryBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.opensearch.index.query.QueryBuilderconvertDefaultTermQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query for the default field with fuzzy matching support.protected org.opensearch.index.query.QueryBuilderconvertKeywordQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query to a keyword-based exact term query.protected org.opensearch.index.query.QueryBuilderconvertPrefixQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query ending with asterisk to a prefix query.protected org.opensearch.index.query.QueryBuilderconvertSiteQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a site field query to a prefix query for site filtering.protected org.opensearch.index.query.QueryBuilderconvertSortQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a sort field query to add sort criteria to the context.protected org.opensearch.index.query.QueryBuilderconvertTermQuery(QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost) Converts a TermQuery to a QueryBuilder with the given boost value.protected org.opensearch.index.query.QueryBuilderconvertTermQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a TermQuery to a QueryBuilder with field-specific handling.protected org.opensearch.index.query.QueryBuilderconvertTextQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query to a text-based match phrase query.protected org.opensearch.index.query.QueryBuilderconvertWildcardQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query to a wildcard query for URL field matching.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.Methods inherited from class org.codelibs.fess.query.QueryCommand
buildDefaultQueryBuilder, buildMatchPhraseQuery, convertWithFieldCheck, createDefaultQueryBuilder, createFieldSortBuilder, getQueryFieldConfig, getQueryLanguages, getQueryProcessor, getSearchField, isSearchField, register
-
Constructor Details
-
TermQueryCommand
public TermQueryCommand()Default constructor for TermQueryCommand.
-
-
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.
-
convertTermQuery
protected org.opensearch.index.query.QueryBuilder convertTermQuery(QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost) Converts a TermQuery to a QueryBuilder with the given boost value.- Parameters:
context- the query contexttermQuery- the term query to convertboost- the boost value to apply- Returns:
- the converted QueryBuilder
-
convertTermQuery
protected org.opensearch.index.query.QueryBuilder convertTermQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a TermQuery to a QueryBuilder with field-specific handling.- Parameters:
fessConfig- the Fess configurationcontext- the query contexttermQuery- the term query to convertboost- the boost value to applyfield- the field nametext- the query text- Returns:
- the converted QueryBuilder
-
convertTextQuery
protected org.opensearch.index.query.QueryBuilder convertTextQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query to a text-based match phrase query.- Parameters:
fessConfig- the Fess configurationcontext- the query contexttermQuery- the term query to convertboost- the boost value to applyfield- the field nametext- the query text- Returns:
- the converted QueryBuilder
-
convertKeywordQuery
protected org.opensearch.index.query.QueryBuilder convertKeywordQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query to a keyword-based exact term query.- Parameters:
fessConfig- the Fess configurationcontext- the query contexttermQuery- the term query to convertboost- the boost value to applyfield- the field nametext- the query text- Returns:
- the converted QueryBuilder
-
convertWildcardQuery
protected org.opensearch.index.query.QueryBuilder convertWildcardQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query to a wildcard query for URL field matching.- Parameters:
fessConfig- the Fess configurationcontext- the query contexttermQuery- the term query to convertboost- the boost value to applyfield- the field nametext- the query text- Returns:
- the converted QueryBuilder
-
convertPrefixQuery
protected org.opensearch.index.query.QueryBuilder convertPrefixQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query ending with asterisk to a prefix query.- Parameters:
fessConfig- the Fess configurationcontext- the query contexttermQuery- the term query to convertboost- the boost value to applyfield- the field nametext- the query text- Returns:
- the converted QueryBuilder
-
convertSortQuery
protected org.opensearch.index.query.QueryBuilder convertSortQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a sort field query to add sort criteria to the context.- Parameters:
fessConfig- the Fess configurationcontext- the query contexttermQuery- the term query to convertboost- the boost value to applyfield- the field nametext- the query text- Returns:
- null as this method only adds sort criteria
-
convertDefaultTermQuery
protected org.opensearch.index.query.QueryBuilder convertDefaultTermQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a term query for the default field with fuzzy matching support.- Parameters:
fessConfig- the Fess configurationcontext- the query contexttermQuery- the term query to convertboost- the boost value to applyfield- the field nametext- the query text- Returns:
- the converted QueryBuilder
-
convertSiteQuery
protected org.opensearch.index.query.QueryBuilder convertSiteQuery(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, QueryContext context, org.apache.lucene.search.TermQuery termQuery, float boost, String field, String text) Converts a site field query to a prefix query for site filtering.- Parameters:
fessConfig- the Fess configurationcontext- the query contexttermQuery- the term query to convertboost- the boost value to applyfield- the field nametext- the query text- Returns:
- the converted QueryBuilder
-