Class SearchImpl
- java.lang.Object
-
- org.apache.lucene.luke.models.LukeModel
-
- org.apache.lucene.luke.models.search.SearchImpl
-
-
Constructor Summary
Constructors Constructor Description SearchImpl(IndexReader reader)Constructs a SearchImpl that holds givenIndexReader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Explanationexplain(Query query, int docid)Explains the document for the specified query.QuerygetCurrentQuery()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 theSortFieldfor the specified field with the sort type and order.List<SortField>guessSortTypes(String name)Returns possibleSortFields for the specified field.QuerymltQuery(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.QueryparseQuery(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.SearchResultssearch(Query query, SimilarityConfig simConfig, Set<String> fieldsToLoad, int pageSize, boolean exactHitsCount)Searches this index by the query with given configurations.SearchResultssearch(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.-
Methods inherited from class org.apache.lucene.luke.models.LukeModel
getFieldNames
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.luke.models.search.Search
getFieldNames
-
-
-
-
Constructor Detail
-
SearchImpl
public SearchImpl(IndexReader reader)
Constructs a SearchImpl that holds givenIndexReader- Parameters:
reader- - the index reader
-
-
Method Detail
-
getSortableFieldNames
public Collection<String> getSortableFieldNames()
Description copied from interface:SearchReturns field names those are sortable.- Specified by:
getSortableFieldNamesin interfaceSearch
-
getSearchableFieldNames
public Collection<String> getSearchableFieldNames()
Description copied from interface:SearchReturns field names those are searchable.- Specified by:
getSearchableFieldNamesin interfaceSearch
-
getRangeSearchableFieldNames
public Collection<String> getRangeSearchableFieldNames()
Description copied from interface:SearchReturns field names those are searchable by range query.- Specified by:
getRangeSearchableFieldNamesin interfaceSearch
-
getCurrentQuery
public Query getCurrentQuery()
Description copied from interface:SearchReturns the current query.- Specified by:
getCurrentQueryin interfaceSearch
-
parseQuery
public Query parseQuery(String expression, String defField, Analyzer analyzer, QueryParserConfig config, boolean rewrite)
Description copied from interface:SearchParses the specified query expression with given configurations.- Specified by:
parseQueryin interfaceSearch- Parameters:
expression- - query expressiondefField- - default field for the queryanalyzer- - analyzer for parsing query expressionconfig- - query parser configurationrewrite- - if true, re-written query is returned- Returns:
- parsed query
-
mltQuery
public Query mltQuery(int docid, MLTConfig mltConfig, Analyzer analyzer)
Description copied from interface:SearchCreates the MoreLikeThis query for the specified document with given configurations.
-
search
public SearchResults search(Query query, SimilarityConfig simConfig, Set<String> fieldsToLoad, int pageSize, boolean exactHitsCount)
Description copied from interface:SearchSearches this index by the query with given configurations.
-
search
public SearchResults search(Query query, SimilarityConfig simConfig, Sort sort, Set<String> fieldsToLoad, int pageSize, boolean exactHitsCount)
Description copied from interface:SearchSearches this index by the query with given sort criteria and configurations.
-
nextPage
public Optional<SearchResults> nextPage()
Description copied from interface:SearchReturns the next page for the current query.
-
prevPage
public Optional<SearchResults> prevPage()
Description copied from interface:SearchReturns the previous page for the current query.
-
guessSortTypes
public List<SortField> guessSortTypes(String name)
Description copied from interface:SearchReturns possibleSortFields for the specified field.- Specified by:
guessSortTypesin interfaceSearch- Parameters:
name- - field name- Returns:
- list of possible sort types
-
getSortType
public Optional<SortField> getSortType(String name, String type, boolean reverse)
Description copied from interface:SearchReturns theSortFieldfor the specified field with the sort type and order.- Specified by:
getSortTypein interfaceSearch- Parameters:
name- - field nametype- - string representation for a typereverse- - if true, descending order is used- Returns:
- sort type, or empty if the type is incompatible with the field
-
explain
public Explanation explain(Query query, int docid)
Description copied from interface:SearchExplains the document for the specified query.
-
-