public interface Search
Modifier and Type | Method and Description |
---|---|
Explanation |
explain(Query query,
int docid)
Explains the document for the specified query.
|
Query |
getCurrentQuery()
Returns the current query.
|
Collection<String> |
getFieldNames()
Returns all field names in this index.
|
Collection<String> |
getRangeSearchableFieldNames()
Returns field names those are searchable by range query.
|
Collection<String> |
getSearchableFieldNames()
Returns field names those are searchable.
|
Collection<String> |
getSortableFieldNames()
Returns field names those are sortable.
|
Optional<SortField> |
getSortType(String name,
String type,
boolean reverse)
Returns the
SortField for the specified field with the sort type and order. |
List<SortField> |
guessSortTypes(String name)
Returns possible
SortField s for the specified field. |
Query |
mltQuery(int docid,
MLTConfig mltConfig,
Analyzer analyzer)
Creates the MoreLikeThis query for the specified document with given configurations.
|
Optional<SearchResults> |
nextPage()
Returns the next page for the current query.
|
Query |
parseQuery(String expression,
String defField,
Analyzer analyzer,
QueryParserConfig config,
boolean rewrite)
Parses the specified query expression with given configurations.
|
Optional<SearchResults> |
prevPage()
Returns the previous page for the current query.
|
SearchResults |
search(Query query,
SimilarityConfig simConfig,
Set<String> fieldsToLoad,
int pageSize,
boolean exactHitsCount)
Searches this index by the query with given configurations.
|
SearchResults |
search(Query query,
SimilarityConfig simConfig,
Sort sort,
Set<String> fieldsToLoad,
int pageSize,
boolean exactHitsCount)
Searches this index by the query with given sort criteria and configurations.
|
Collection<String> getFieldNames()
Collection<String> getSortableFieldNames()
Collection<String> getSearchableFieldNames()
Collection<String> getRangeSearchableFieldNames()
Query getCurrentQuery()
Query parseQuery(String expression, String defField, Analyzer analyzer, QueryParserConfig config, boolean rewrite)
expression
- - query expressiondefField
- - default field for the queryanalyzer
- - analyzer for parsing query expressionconfig
- - query parser configurationrewrite
- - if true, re-written query is returnedLukeException
- - if an internal error occurs when accessing indexQuery mltQuery(int docid, MLTConfig mltConfig, Analyzer analyzer)
docid
- - document idmltConfig
- - MoreLikeThis configurationanalyzer
- - analyzer for analyzing the documentLukeException
- - if an internal error occurs when accessing indexSearchResults search(Query query, SimilarityConfig simConfig, Set<String> fieldsToLoad, int pageSize, boolean exactHitsCount)
query
- - search querysimConfig
- - similarity configurationfieldsToLoad
- - field names to loadpageSize
- - page sizeexactHitsCount
- - if set to true, the exact total hits count is returned.LukeException
- - if an internal error occurs when accessing indexSearchResults search(Query query, SimilarityConfig simConfig, Sort sort, Set<String> fieldsToLoad, int pageSize, boolean exactHitsCount)
query
- - search querysimConfig
- - similarity configurationsort
- - sort criteriafieldsToLoad
- - fields to loadpageSize
- - page sizeexactHitsCount
- - if set to true, the exact total hits count is returned.LukeException
- - if an internal error occurs when accessing indexOptional<SearchResults> nextPage()
LukeException
- - if an internal error occurs when accessing indexOptional<SearchResults> prevPage()
LukeException
- - if an internal error occurs when accessing indexExplanation explain(Query query, int docid)
query
- - querydocid
- - document id to be explainedLukeException
- - if an internal error occurs when accessing indexList<SortField> guessSortTypes(String name)
SortField
s for the specified field.name
- - field nameLukeException
- - if an internal error occurs when accessing indexOptional<SortField> getSortType(String name, String type, boolean reverse)
SortField
for the specified field with the sort type and order.name
- - field nametype
- - string representation for a typereverse
- - if true, descending order is usedLukeException
- - if an internal error occurs when accessing indexCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.