Class AbstractSearchQuery<H,R extends SearchResult<H>>
- java.lang.Object
-
- org.hibernate.search.engine.search.query.spi.AbstractSearchQuery<H,R>
-
- Type Parameters:
H- The type of query hits.R- The result type (extendingSearchResult).
- All Implemented Interfaces:
SearchFetchable<H>,SearchQuery<H>,SearchQueryImplementor<H>
public abstract class AbstractSearchQuery<H,R extends SearchResult<H>> extends Object implements SearchQueryImplementor<H>
An abstract base for implementations ofSearchQuery.
-
-
Constructor Summary
Constructors Constructor Description AbstractSearchQuery()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Rfetch(Integer limit)Execute the query and return theSearchResult, limiting tolimithits.abstract Rfetch(Integer offset, Integer limit)RfetchAll()Execute the query and return theSearchResult, including all hits, without any sort of limit.List<H>fetchAllHits()Execute the query and return all hits as aList, without any sort of limit.List<H>fetchHits(Integer limit)Execute the query and return the hits as aList, limiting tolimithits.List<H>fetchHits(Integer offset, Integer limit)Optional<H>fetchSingleHit()Execute the query and return the hits as a single, optional element.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.engine.search.query.SearchFetchable
fetchTotalHitCount, scroll
-
Methods inherited from interface org.hibernate.search.engine.search.query.SearchQuery
extension, getQueryString, queryString
-
Methods inherited from interface org.hibernate.search.engine.search.query.spi.SearchQueryImplementor
failAfter
-
-
-
-
Method Detail
-
fetchAll
public R fetchAll()
Description copied from interface:SearchFetchableExecute the query and return theSearchResult, including all hits, without any sort of limit.SearchFetchable.fetch(Integer)orSearchFetchable.fetch(Integer, Integer)should generally be preferred, for performance reasons.- Specified by:
fetchAllin interfaceSearchFetchable<H>- Returns:
- The
SearchResult.
-
fetch
public R fetch(Integer limit)
Description copied from interface:SearchFetchableExecute the query and return theSearchResult, limiting tolimithits.- Specified by:
fetchin interfaceSearchFetchable<H>- Parameters:
limit- The maximum number of hits to be included in theSearchResult.nullmeans no limit.- Returns:
- The
SearchResult.
-
fetch
public abstract R fetch(Integer offset, Integer limit)
Description copied from interface:SearchFetchable- Specified by:
fetchin interfaceSearchFetchable<H>- Parameters:
offset- The number of hits to skip before adding the hits to theSearchResult.nullmeans no offset.limit- The maximum number of hits to be included in theSearchResult.nullmeans no limit.- Returns:
- The
SearchResult.
-
fetchAllHits
public List<H> fetchAllHits()
Description copied from interface:SearchFetchableExecute the query and return all hits as aList, without any sort of limit.SearchFetchable.fetchHits(Integer)orSearchFetchable.fetchHits(Integer, Integer)should generally be preferred, for performance reasons.- Specified by:
fetchAllHitsin interfaceSearchFetchable<H>- Returns:
- The query hits.
-
fetchHits
public List<H> fetchHits(Integer limit)
Description copied from interface:SearchFetchableExecute the query and return the hits as aList, limiting tolimithits.- Specified by:
fetchHitsin interfaceSearchFetchable<H>- Parameters:
limit- The maximum number of hits to be returned by this method.nullmeans no limit.- Returns:
- The query hits.
-
fetchHits
public List<H> fetchHits(Integer offset, Integer limit)
Description copied from interface:SearchFetchable- Specified by:
fetchHitsin interfaceSearchFetchable<H>- Parameters:
offset- The number of hits to skip.nullmeans no offset.limit- The maximum number of hits to be returned by this method.nullmeans no limit.- Returns:
- The query hits.
-
fetchSingleHit
public Optional<H> fetchSingleHit()
Description copied from interface:SearchFetchableExecute the query and return the hits as a single, optional element.- Specified by:
fetchSingleHitin interfaceSearchFetchable<H>- Returns:
- The single, optional query hit.
-
-