H - The type of query hits.R - The result type (extending SearchResult).public abstract class AbstractSearchQuery<H,R extends SearchResult<H>> extends Object implements SearchQuery<H>
SearchQuery.| Constructor and Description |
|---|
AbstractSearchQuery() |
| Modifier and Type | Method and Description |
|---|---|
R |
fetch(Integer limit)
Execute the query and return the
SearchResult,
limiting to limit hits. |
abstract R |
fetch(Integer offset,
Integer limit)
|
R |
fetchAll()
Execute the query and return the
SearchResult,
including all hits, without any sort of limit. |
List<H> |
fetchAllHits()
Execute the query and return all hits as a
List,
without any sort of limit. |
List<H> |
fetchHits(Integer limit)
Execute the query and return the hits as a
List,
limiting to limit hits. |
List<H> |
fetchHits(Integer offset,
Integer limit)
|
Optional<H> |
fetchSingleHit()
Execute the query and return the hits as a single, optional element.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitextension, getQueryStringfetchTotalHitCountpublic R fetchAll()
SearchFetchableSearchResult,
including all hits, without any sort of limit.
SearchFetchable.fetch(Integer) or SearchFetchable.fetch(Integer, Integer) should generally be preferred, for performance reasons.
fetchAll in interface SearchFetchable<H>SearchResult.public R fetch(Integer limit)
SearchFetchableSearchResult,
limiting to limit hits.fetch in interface SearchFetchable<H>limit - The maximum number of hits to be included in the SearchResult. null means no limit.SearchResult.public abstract R fetch(Integer offset, Integer limit)
SearchFetchablefetch in interface SearchFetchable<H>offset - The number of hits to skip before adding the hits to the SearchResult. null means no offset.limit - The maximum number of hits to be included in the SearchResult. null means no limit.SearchResult.public List<H> fetchAllHits()
SearchFetchableList,
without any sort of limit.
SearchFetchable.fetchHits(Integer) or SearchFetchable.fetchHits(Integer, Integer) should generally be preferred,
for performance reasons.
fetchAllHits in interface SearchFetchable<H>public List<H> fetchHits(Integer limit)
SearchFetchableList,
limiting to limit hits.fetchHits in interface SearchFetchable<H>limit - The maximum number of hits to be returned by this method. null means no limit.public List<H> fetchHits(Integer offset, Integer limit)
SearchFetchablefetchHits in interface SearchFetchable<H>offset - The number of hits to skip. null means no offset.limit - The maximum number of hits to be returned by this method. null means no limit.public Optional<H> fetchSingleHit()
SearchFetchablefetchSingleHit in interface SearchFetchable<H>Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.