Package org.apache.maven.index
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 Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.Query
constructQuery
(String field, String query) Deprecated.org.apache.lucene.search.Query
constructQuery
(Field field, String query, SearchType type) Deprecated.UseconstructQuery(Field, SearchExpression)
instead.org.apache.lucene.search.Query
constructQuery
(Field field, SearchExpression expression) Constructs query by parsing the query string, using field as default field.selectIndexerField
(Field field, SearchType type) Performs a selection of the appropriate IndexerField belonging to proper Field.
-
Method Details
-
selectIndexerField
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
org.apache.lucene.search.Query constructQuery(Field field, String query, SearchType type) throws org.apache.lucene.queryparser.classic.ParseException Deprecated.UseconstructQuery(Field, SearchExpression)
instead.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.UseconstructQuery(Field, SearchExpression)
instead.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.
-
constructQuery(Field, SearchExpression)
instead.