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.
    • Field Detail

      • ROLE

        static final java.lang.String ROLE
    • Method Detail

      • 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 -
        query -
        type -
        Returns:
        Throws:
        org.apache.lucene.queryparser.classic.ParseException - if query parsing is unsuccessful.
      • constructQuery

        org.apache.lucene.search.Query constructQuery​(Field field,
                                                      java.lang.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

        org.apache.lucene.search.Query constructQuery​(java.lang.String field,
                                                      java.lang.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.