Interface SearchQueryResult
-
- All Superinterfaces:
Iterable<SearchQueryRow>
- All Known Implementing Classes:
DefaultSearchQueryResult
@Committed @Public public interface SearchQueryResult extends Iterable<SearchQueryRow>
The main interface for FTS query results. It is also anIterable<SearchQueryRow>
, where iteration is similar to iterating overhitsOrFail()
.- Since:
- 2.3.0
- Author:
- Simon Baslé, Michael Nitschinger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>
errors()
When an execution error happens (including partial results), this method returns aList
of the error(s) inJSON format
.Map<String,FacetResult>
facets()
If one or more facet were requested via theSearchQuery.addFacet(String, SearchFacet)
method when querying, contains the result of each facet.List<SearchQueryRow>
hits()
The list of FTS result rows, or "hits", for the FTS query.List<SearchQueryRow>
hitsOrFail()
The list of FTS result rows, or "hits", for the FTS query.Iterator<SearchQueryRow>
iterator()
Returns an iterator over the hits (SearchQueryRow
).SearchMetrics
metrics()
Provides aSearchMetrics
object giving statistics on the request like number of hits, total time taken...SearchStatus
status()
TheSearchStatus
allows to check if the request was a full success (SearchStatus.isSuccess()
) and gives more details about status for each queried index.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
status
SearchStatus status()
TheSearchStatus
allows to check if the request was a full success (SearchStatus.isSuccess()
) and gives more details about status for each queried index.
-
hits
List<SearchQueryRow> hits()
The list of FTS result rows, or "hits", for the FTS query. This method always returns a list, including when an execution error (eg. partial results) occurred.
-
hitsOrFail
List<SearchQueryRow> hitsOrFail()
The list of FTS result rows, or "hits", for the FTS query. In case of an execution error (eg. partial results), aCompositeException
is thrown instead.
-
errors
List<String> errors()
When an execution error happens (including partial results), this method returns aList
of the error(s) inJSON format
.
-
facets
Map<String,FacetResult> facets()
If one or more facet were requested via theSearchQuery.addFacet(String, SearchFacet)
method when querying, contains the result of each facet.The map keys are the names given to each requested facet.
-
metrics
SearchMetrics metrics()
Provides aSearchMetrics
object giving statistics on the request like number of hits, total time taken...
-
iterator
Iterator<SearchQueryRow> iterator()
Returns an iterator over the hits (SearchQueryRow
). If an execution error happened, the corresponding exception is thrown instead (same as attempting to iterate overhitsOrFail()
).- Specified by:
iterator
in interfaceIterable<SearchQueryRow>
- Returns:
- an Iterator of rows/hits.
-
-