Class WildcardQueryCommand

java.lang.Object
org.codelibs.fess.query.QueryCommand
org.codelibs.fess.query.WildcardQueryCommand

public class WildcardQueryCommand extends QueryCommand
Query command for handling wildcard queries. Converts Lucene WildcardQuery objects to OpenSearch QueryBuilder objects, supporting wildcard pattern matching with configurable case sensitivity.
  • Field Details

    • lowercaseWildcard

      protected boolean lowercaseWildcard
      Flag indicating whether wildcard terms should be converted to lowercase.
  • Constructor Details

    • WildcardQueryCommand

      public WildcardQueryCommand()
      Default constructor.
  • Method Details

    • getQueryClassName

      protected String getQueryClassName()
      Description copied from class: QueryCommand
      Gets the class name of the query this command handles.
      Specified by:
      getQueryClassName in class QueryCommand
      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: QueryCommand
      Executes the query command and returns a QueryBuilder.
      Specified by:
      execute in class QueryCommand
      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 information
      wildcardQuery - The Lucene wildcard query to convert
      boost - The boost factor to apply to the query
      Returns:
      The converted OpenSearch QueryBuilder
    • toLowercaseWildcard

      protected String toLowercaseWildcard(String value)
      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