Package org.nuxeo.ecm.core.search
Interface SearchResponse
- All Known Implementing Classes:
SearchResponseImpl
public interface SearchResponse
- Since:
- 2025.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic SearchResponseImpl.Builder
Returns the aggregates.getHits()
Returns the search hits.Returns search hits as an iterator, the query must be a scroll query.Returns search hits as a partial list.long
Returns the number of returned search hits, taking in account limits.Returns the list ofSearchClient.Capability
that are missing to fully perform the SearchQuery.Returns a scroll context to use inSearchService.searchScroll(SearchScrollContext)
to fetch the next batch of results.long
getTotal()
Get the total number of match for the query.default boolean
Returnstrue
if the response is provided but search client lacks some search capabilities.boolean
Returnstrue
if the total is accurate, i.e. not an estimation.loadDocuments
(CoreSession defaultSession) Loads search hits from repository as a DocumentModelList using the provided session.
-
Method Details
-
getTotal
long getTotal()Get the total number of match for the query. Limit is not taken in account.- Returns:
-1
if unknown.
-
isTotalAccurate
boolean isTotalAccurate()Returnstrue
if the total is accurate, i.e. not an estimation. -
getHitsCount
long getHitsCount()Returns the number of returned search hits, taking in account limits. -
getHits
Returns the search hits. -
getHitsAsMap
PartialList<Map<String,Serializable>> getHitsAsMap()Returns search hits as a partial list. -
getHitsAsIterator
IterableQueryResult getHitsAsIterator()Returns search hits as an iterator, the query must be a scroll query.- Throws:
IllegalArgumentException
- if the query is not of scroll type.
-
isMissingCapabilities
default boolean isMissingCapabilities()Returnstrue
if the response is provided but search client lacks some search capabilities. -
getMissingCapabilities
List<SearchClient.Capability> getMissingCapabilities()Returns the list ofSearchClient.Capability
that are missing to fully perform the SearchQuery. -
getScrollContext
Returns a scroll context to use inSearchService.searchScroll(SearchScrollContext)
to fetch the next batch of results. -
getAggregates
Returns the aggregates. -
loadDocuments
Loads search hits from repository as a DocumentModelList using the provided session. Can be an expensive operation. In the case of a multi repository search, additional sessions are created using the defaultSession principal. -
builder
- Returns:
- a
SearchResponse
builder.
-