Constructor and Description |
---|
SearchImpl(IndexReader reader)
Constructs a SearchImpl that holds given
IndexReader |
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> |
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.
|
getFieldNames
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFieldNames
public SearchImpl(IndexReader reader)
IndexReader
reader
- - the index readerpublic Collection<String> getSortableFieldNames()
Search
getSortableFieldNames
in interface Search
public Collection<String> getSearchableFieldNames()
Search
getSearchableFieldNames
in interface Search
public Collection<String> getRangeSearchableFieldNames()
Search
getRangeSearchableFieldNames
in interface Search
public Query getCurrentQuery()
Search
getCurrentQuery
in interface Search
public Query parseQuery(String expression, String defField, Analyzer analyzer, QueryParserConfig config, boolean rewrite)
Search
parseQuery
in interface Search
expression
- - query expressiondefField
- - default field for the queryanalyzer
- - analyzer for parsing query expressionconfig
- - query parser configurationrewrite
- - if true, re-written query is returnedpublic Query mltQuery(int docid, MLTConfig mltConfig, Analyzer analyzer)
Search
public SearchResults search(Query query, SimilarityConfig simConfig, Set<String> fieldsToLoad, int pageSize, boolean exactHitsCount)
Search
public SearchResults search(Query query, SimilarityConfig simConfig, Sort sort, Set<String> fieldsToLoad, int pageSize, boolean exactHitsCount)
Search
public Optional<SearchResults> nextPage()
Search
public Optional<SearchResults> prevPage()
Search
public List<SortField> guessSortTypes(String name)
Search
SortField
s for the specified field.guessSortTypes
in interface Search
name
- - field namepublic Optional<SortField> getSortType(String name, String type, boolean reverse)
Search
SortField
for the specified field with the sort type and order.getSortType
in interface Search
name
- - field nametype
- - string representation for a typereverse
- - if true, descending order is usedpublic Explanation explain(Query query, int docid)
Search
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.