@InterfaceStability.Committed @InterfaceAudience.Public public class DefaultSearchQueryResult extends Object implements SearchQueryResult
The default implementation for a SearchQueryResult
| Modifier and Type | Field and Description |
|---|---|
static rx.functions.Func1<AsyncSearchQueryResult,rx.Observable<SearchQueryResult>> |
FROM_ASYNC
|
| Constructor and Description |
|---|
DefaultSearchQueryResult(SearchStatus status,
List<SearchQueryRow> hits,
Throwable error,
Map<String,FacetResult> facets,
SearchMetrics metrics) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
errors()
When an execution error happens (including partial results), this method returns a
List of the error(s) in JSON format. |
Map<String,FacetResult> |
facets()
If one or more facet were requested via the
SearchQuery#addFacets(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 a
SearchMetrics object giving statistics on the request like number of hits, total time taken… |
SearchStatus |
status()
The
SearchStatus allows to check if the request was a full success (SearchStatus.isSuccess()) and gives more details about status for each queried index. |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static final rx.functions.Func1<AsyncSearchQueryResult,rx.Observable<SearchQueryResult>> FROM_ASYNC
Utility Func1 to convert an AsyncSearchQueryResult into a synchronous SearchQueryResult.
public DefaultSearchQueryResult(SearchStatus status, List<SearchQueryRow> hits, Throwable error, Map<String,FacetResult> facets, SearchMetrics metrics)
public SearchStatus status()
SearchQueryResultThe SearchStatus allows to check if the request was a full success (SearchStatus.isSuccess()) and gives more details about status for each queried index.
status in interface SearchQueryResultpublic List<SearchQueryRow> hits()
SearchQueryResultThe 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.
hits in interface SearchQueryResultfor a variant that throws an exception whenever execution errors have occurred.,
to get a list of execution errors in JSON form.public List<SearchQueryRow> hitsOrFail()
SearchQueryResultThe list of FTS result rows, or “hits”, for the FTS query. In case of an execution error (eg. partial results), a CompositeException is thrown instead.
hitsOrFail in interface SearchQueryResultfor a variant that lists partial results instead of throwing the exception.,
to get a list of execution errors in JSON form.public Iterator<SearchQueryRow> iterator()
SearchQueryResultReturns an iterator over the hits (SearchQueryRow). If an execution error happened, the corresponding exception is thrown instead (same as attempting to iterate over SearchQueryResult.hitsOrFail()).
iterator in interface SearchQueryResultiterator in interface Iterable<SearchQueryRow>public List<String> errors()
SearchQueryResultWhen an execution error happens (including partial results), this method returns a List of the error(s) in JSON format.
public Map<String,FacetResult> facets()
SearchQueryResultIf one or more facet were requested via the SearchQuery#addFacets(SearchFacet...) method when querying, contains the result of each facet. The map keys are the names given to each requested facet.
facets in interface SearchQueryResultpublic SearchMetrics metrics()
SearchQueryResultProvides a SearchMetrics object giving statistics on the request like number of hits, total time taken…
metrics in interface SearchQueryResultCopyright © 2015 Couchbase, Inc.