Interface QueryCreator

All Known Implementing Classes:
DefaultQueryCreator

public interface QueryCreator
A component the creates Lucene Queries from "human written" queries, but also helps client applications to assemble proper queries for fields they want to search.
Author:
Tamas Cservenak
  • Method Details

    • selectIndexerField

      IndexerField selectIndexerField(Field field, SearchType type)
      Performs a selection of the appropriate IndexerField belonging to proper Field.
      Parameters:
      field -
      type -
      Returns:
    • constructQuery

      org.apache.lucene.search.Query constructQuery(Field field, SearchExpression expression) throws org.apache.lucene.queryparser.classic.ParseException
      Constructs query by parsing the query string, using field as default field. This method should be use to construct queries (single term or phrase queries) against single field.
      Parameters:
      field -
      expression -
      Returns:
      Throws:
      org.apache.lucene.queryparser.classic.ParseException - if query parsing is unsuccessful.
    • constructQuery

      @Deprecated org.apache.lucene.search.Query constructQuery(Field field, String query, SearchType type) throws org.apache.lucene.queryparser.classic.ParseException
      Deprecated.
      Constructs query by parsing the query string, using field as default field. This method should be use to construct queries (single term or phrase queries) against single field.
      Parameters:
      field -
      query -
      type -
      Returns:
      Throws:
      org.apache.lucene.queryparser.classic.ParseException - if query parsing is unsuccessful.
    • constructQuery

      @Deprecated org.apache.lucene.search.Query constructQuery(String field, String query)
      Deprecated.
      Deprecated. Avoid it's use! Constructs query against single field, using it's "best effort" approach to perform parsing, but letting caller to apply it's (usually wrong) knowledge about how field is indexed.
      Parameters:
      field -
      query -
      Returns:
      query if successfully parsed, or null.