Class AbstractExtendedSearchQueryOptionsStep<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>,H,R extends SearchResult<H>,SCR extends SearchScroll<H>,LOS,PDF extends SearchPredicateFactory,SF extends SearchSortFactory,AF extends SearchAggregationFactory,SC extends SearchQueryIndexScope<?>>
- java.lang.Object
-
- org.hibernate.search.engine.search.query.dsl.spi.AbstractSearchQueryOptionsStep<S,H,LOS,PDF,SF,AF,SC>
-
- org.hibernate.search.engine.search.query.dsl.spi.AbstractExtendedSearchQueryOptionsStep<S,H,R,SCR,LOS,PDF,SF,AF,SC>
-
- All Implemented Interfaces:
SearchQueryFinalStep<H>
,SearchQueryOptionsStep<S,H,LOS,SF,AF>
,SearchQueryWhereStep<S,H,LOS,PDF>
,SearchFetchable<H>
public abstract class AbstractExtendedSearchQueryOptionsStep<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>,H,R extends SearchResult<H>,SCR extends SearchScroll<H>,LOS,PDF extends SearchPredicateFactory,SF extends SearchSortFactory,AF extends SearchAggregationFactory,SC extends SearchQueryIndexScope<?>> extends AbstractSearchQueryOptionsStep<S,H,LOS,PDF,SF,AF,SC>
-
-
Field Summary
-
Fields inherited from class org.hibernate.search.engine.search.query.dsl.spi.AbstractSearchQueryOptionsStep
scope
-
-
Constructor Summary
Constructors Constructor Description AbstractExtendedSearchQueryOptionsStep(SC scope, SearchQueryBuilder<H> searchQueryBuilder, SearchLoadingContextBuilder<?,?,LOS> loadingContextBuilder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description R
fetch(Integer limit)
Execute the query and return theSearchResult
, limiting tolimit
hits.R
fetch(Integer offset, Integer limit)
R
fetchAll()
Execute the query and return theSearchResult
, including all hits, without any sort of limit.SCR
scroll(int chunkSize)
Execute the query continuously to deliver results in small chunks through aSearchScroll
.abstract ExtendedSearchQuery<H,R,SCR>
toQuery()
Create aSearchQuery
instance matching the definition given in the previous DSL steps.-
Methods inherited from class org.hibernate.search.engine.search.query.dsl.spi.AbstractSearchQueryOptionsStep
aggregation, aggregation, aggregationFactory, failAfter, fetchAllHits, fetchHits, fetchHits, fetchSingleHit, fetchTotalHitCount, loading, predicateFactory, routing, routing, sort, sort, sortFactory, thisAsS, totalHitCountThreshold, truncateAfter, where, where
-
-
-
-
Constructor Detail
-
AbstractExtendedSearchQueryOptionsStep
public AbstractExtendedSearchQueryOptionsStep(SC scope, SearchQueryBuilder<H> searchQueryBuilder, SearchLoadingContextBuilder<?,?,LOS> loadingContextBuilder)
-
-
Method Detail
-
toQuery
public abstract ExtendedSearchQuery<H,R,SCR> toQuery()
Description copied from interface:SearchQueryFinalStep
Create aSearchQuery
instance matching the definition given in the previous DSL steps.Calling this method is generally not necessary as most query execution methods are also implemented by this DSL step, so for example
.toQuery().fetch()
can be replaced with simply.fetch()
.- Specified by:
toQuery
in interfaceSearchQueryFinalStep<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>>
- Overrides:
toQuery
in classAbstractSearchQueryOptionsStep<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>,H,LOS,PDF extends SearchPredicateFactory,SF extends SearchSortFactory,AF extends SearchAggregationFactory,SC extends SearchQueryIndexScope<?>>
- Returns:
- The
SearchQuery
resulting from the previous DSL steps.
-
fetchAll
public R fetchAll()
Description copied from interface:SearchFetchable
Execute 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:
fetchAll
in interfaceSearchFetchable<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>>
- Overrides:
fetchAll
in classAbstractSearchQueryOptionsStep<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>,H,LOS,PDF extends SearchPredicateFactory,SF extends SearchSortFactory,AF extends SearchAggregationFactory,SC extends SearchQueryIndexScope<?>>
- Returns:
- The
SearchResult
.
-
fetch
public R fetch(Integer limit)
Description copied from interface:SearchFetchable
Execute the query and return theSearchResult
, limiting tolimit
hits.- Specified by:
fetch
in interfaceSearchFetchable<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>>
- Overrides:
fetch
in classAbstractSearchQueryOptionsStep<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>,H,LOS,PDF extends SearchPredicateFactory,SF extends SearchSortFactory,AF extends SearchAggregationFactory,SC extends SearchQueryIndexScope<?>>
- Parameters:
limit
- The maximum number of hits to be included in theSearchResult
.null
means no limit.- Returns:
- The
SearchResult
.
-
fetch
public R fetch(Integer offset, Integer limit)
Description copied from interface:SearchFetchable
- Specified by:
fetch
in interfaceSearchFetchable<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>>
- Overrides:
fetch
in classAbstractSearchQueryOptionsStep<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>,H,LOS,PDF extends SearchPredicateFactory,SF extends SearchSortFactory,AF extends SearchAggregationFactory,SC extends SearchQueryIndexScope<?>>
- Parameters:
offset
- The number of hits to skip before adding the hits to theSearchResult
.null
means no offset.limit
- The maximum number of hits to be included in theSearchResult
.null
means no limit.- Returns:
- The
SearchResult
.
-
scroll
public SCR scroll(int chunkSize)
Description copied from interface:SearchFetchable
Execute the query continuously to deliver results in small chunks through aSearchScroll
.Useful to process large datasets.
- Specified by:
scroll
in interfaceSearchFetchable<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>>
- Overrides:
scroll
in classAbstractSearchQueryOptionsStep<S extends SearchQueryOptionsStep<S,H,LOS,SF,AF>,H,LOS,PDF extends SearchPredicateFactory,SF extends SearchSortFactory,AF extends SearchAggregationFactory,SC extends SearchQueryIndexScope<?>>
- Parameters:
chunkSize
- The maximum number of hits to be returned for each call toSearchScroll.next()
- Returns:
- The
SearchScroll
.
-
-