Interface SearchQuery
-
- All Known Implementing Classes:
BaseSearchQuery
public interface SearchQueryA collection of search terms that will be used to query the search index. Each of the "set" and "add" methods will return the searchQuery itself, so calls can easily be chained together.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSearchQuery.Order
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SearchQueryaddFacetFields(String... fields)What fields should be used to facet the results?SearchQueryaddFields(String... names)Which fields should be returned from the query?SearchQueryaddFields(Collection<String> names)Which fields should be returned from the query?SearchQueryaddFilterQueries(String... filterQueries)Restrict the results by these queries.SearchQueryaddFilterQuery(String filterQuery)Restrict the results by this query.SearchQueryaddSortField(String name, SearchQuery.Order order)What field should be used to sort the results, and in what order?Set<String>getFacetFields()intgetFacetLimit()intgetFacetMinCount()Set<String>getFieldsToReturn()Set<String>getFilters()StringgetQuery()intgetRows()Map<String,SearchQuery.Order>getSortFields()intgetStart()SearchQuerysetFacetLimit(int cnt)The maximum number of facet counts that will be returned from the query.SearchQuerysetFacetMinCount(int cnt)Facet having fewer hits will be excluded from the list.SearchQuerysetQuery(String query)Set the text of the query.SearchQuerysetRows(int rows)What is the maximum number of documents that will be returned from the query? A negative value means no limit.SearchQuerysetStart(int start)Where in the ordered list of result documents should the response begin? That is, how many of the results should be skipped? (allows paging of results).
-
-
-
Method Detail
-
setQuery
SearchQuery setQuery(String query)
Set the text of the query. This will be parsed using Lucene query syntax.- Returns:
- this query
-
setStart
SearchQuery setStart(int start)
Where in the ordered list of result documents should the response begin? That is, how many of the results should be skipped? (allows paging of results). The default is 0.- Returns:
- this query
-
setRows
SearchQuery setRows(int rows)
What is the maximum number of documents that will be returned from the query? A negative value means no limit. The default is -1.- Returns:
- this query
-
addFields
SearchQuery addFields(String... names)
Which fields should be returned from the query?- Returns:
- this query
-
addFields
SearchQuery addFields(Collection<String> names)
Which fields should be returned from the query?- Returns:
- this query
-
addSortField
SearchQuery addSortField(String name, SearchQuery.Order order)
What field should be used to sort the results, and in what order?- Returns:
- this query
-
addFilterQuery
SearchQuery addFilterQuery(String filterQuery)
Restrict the results by this query.- Returns:
- this query
-
addFilterQueries
SearchQuery addFilterQueries(String... filterQueries)
Restrict the results by these queries.- Returns:
- this query
-
addFacetFields
SearchQuery addFacetFields(String... fields)
What fields should be used to facet the results?- Returns:
- this query
-
setFacetLimit
SearchQuery setFacetLimit(int cnt)
The maximum number of facet counts that will be returned from the query. The default is 100. A negative value means no limit.- Returns:
- this query
-
setFacetMinCount
SearchQuery setFacetMinCount(int cnt)
Facet having fewer hits will be excluded from the list. The default is 0.- Returns:
- this query
-
getQuery
String getQuery()
- Returns:
- The text of the query. May be empty, but never null.
-
getStart
int getStart()
-
getRows
int getRows()
- Returns:
- A negative value means that no limit has been specified.
-
getSortFields
Map<String,SearchQuery.Order> getSortFields()
- Returns:
- May return an empty map, but never null.
-
getFacetLimit
int getFacetLimit()
- Returns:
- A negative value means that no limit has been specified.
-
getFacetMinCount
int getFacetMinCount()
- Returns:
- A negative value means that no limit has been specified.
-
-