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.BuilderReturns 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.longReturns the number of returned search hits, taking in account limits.Returns the list ofSearchClient.Capabilitythat are missing to fully perform the SearchQuery.Returns a scroll context to use inSearchService.searchScroll(SearchScrollContext)to fetch the next batch of results.longgetTotal()Get the total number of match for the query.default booleanReturnstrueif the response is provided but search client lacks some search capabilities.booleanReturnstrueif 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:
-1if unknown.
-
isTotalAccurate
boolean isTotalAccurate()Returnstrueif 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()Returnstrueif the response is provided but search client lacks some search capabilities. -
getMissingCapabilities
List<SearchClient.Capability> getMissingCapabilities()Returns the list ofSearchClient.Capabilitythat 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
SearchResponsebuilder.
-