@InterfaceStability.Experimental @InterfaceAudience.Public public class DefaultAsyncSearchQueryResult extends Object implements AsyncSearchQueryResult
The default implementation for an AsyncSearchQueryResult
| Constructor and Description |
|---|
DefaultAsyncSearchQueryResult(SearchStatus status,
rx.Observable<SearchQueryRow> hits,
rx.Observable<FacetResult> facets,
rx.Observable<SearchMetrics> metrics) |
| Modifier and Type | Method and Description |
|---|---|
rx.Observable<FacetResult> |
facets()
An
Observable emitting a FacetResult for each requested facet in the original request. |
static AsyncSearchQueryResult |
fromHttp400(String payload)
Deprecated.
FTS is still in BETA so the response format is likely to change in a future version, and be unified with the HTTP 200 response format.
|
static AsyncSearchQueryResult |
fromHttp412()
Deprecated.
FTS is still in BETA so the response format is likely to change in a future version, and be unified with the HTTP 200 response format.
|
static AsyncSearchQueryResult |
fromIndexNotFound(String indexName)
Deprecated.
FTS is still in BETA so the response format is likely to change in a future version, and be unified with the HTTP 200 response format.
|
static AsyncSearchQueryResult |
fromJson(JsonObject json)
Deprecated.
FTS is still in BETA so the response format is likely to change in a future version
|
rx.Observable<SearchQueryRow> |
hits()
An
Observable of rows (or hits) describing each individual result. |
rx.Observable<SearchMetrics> |
metrics()
An
Observable asynchronously providing statistics about the request in the form of a single SearchMetrics. |
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. |
public DefaultAsyncSearchQueryResult(SearchStatus status, rx.Observable<SearchQueryRow> hits, rx.Observable<FacetResult> facets, rx.Observable<SearchMetrics> metrics)
public SearchStatus status()
AsyncSearchQueryResultThe 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 AsyncSearchQueryResultpublic rx.Observable<SearchQueryRow> hits()
AsyncSearchQueryResultAn Observable of rows (or hits) describing each individual result. Note that in case of a partial success, Observer.onError(Throwable) will be called after each partial result has been emitted. In case of a full execution failure, no hit is emitted before the onError.
The following execution-level exceptions can happen:
RuntimeException, and all are aggregated into a single CompositeException.CouchbaseException.hits in interface AsyncSearchQueryResultpublic rx.Observable<FacetResult> facets()
AsyncSearchQueryResultAn Observable emitting a FacetResult for each requested facet in the original request.
facets in interface AsyncSearchQueryResultpublic rx.Observable<SearchMetrics> metrics()
AsyncSearchQueryResultAn Observable asynchronously providing statistics about the request in the form of a single SearchMetrics. Note that the metrics are emitted after all hits have been received.
metrics in interface AsyncSearchQueryResult@Deprecated public static AsyncSearchQueryResult fromJson(JsonObject json)
Utility method to extract an AsyncSearchQueryResult from a JSON representation of the whole search service response.
json - the whole response, as returned by the search service.AsyncSearchQueryResult.@Deprecated public static AsyncSearchQueryResult fromHttp400(String payload)
A utility method to convert an HTTP 400 response from the search service into a proper AsyncSearchQueryResult. HTTP 400 indicates the request was malformed and couldn’t be parsed on the server. As of Couchbase Server 4.5 such a response is a text/plain body that describes the parsing error. The whole body is emitted/thrown, wrapped in a FtsMalformedRequestException.
payload - the HTTP 400 response body describing the parsing failure.AsyncSearchQueryResult that will emit a FtsMalformedRequestException when calling its hits() method.@Deprecated public static AsyncSearchQueryResult fromHttp412()
A utility method to convert an HTTP 412 response from the search service into a proper AsyncSearchQueryResult. HTTP 412 indicates the request couldn’t be satisfied with given consistency before the timeout expired. This is translated to a FtsConsistencyTimeoutException.
AsyncSearchQueryResult that will emit a FtsConsistencyTimeoutException when calling its hits() method.@Deprecated public static AsyncSearchQueryResult fromIndexNotFound(String indexName)
A utility method to return a result when the index is not found.
AsyncSearchQueryResult that will emit a IndexDoesNotExistException when calling its hits() method.Copyright © 2015 Couchbase, Inc.