use of com.couchbase.client.java.codec.JsonSerializer in project couchbase-jvm-clients by couchbase.
the class AsyncCluster method searchQuery.
/**
* Performs a Full Text Search (FTS) query with custom {@link SearchOptions}.
*
* @param query the query, in the form of a {@link SearchQuery}
* @param options the custom options for this query.
* @return the {@link SearchRequest} once the response arrives successfully, inside a {@link CompletableFuture}
*/
public CompletableFuture<SearchResult> searchQuery(final String indexName, final SearchQuery query, final SearchOptions options) {
notNull(query, "SearchQuery", () -> new ReducedSearchErrorContext(indexName, null));
notNull(options, "SearchOptions", () -> new ReducedSearchErrorContext(indexName, query.export().toMap()));
SearchOptions.Built opts = options.build();
JsonSerializer serializer = opts.serializer() == null ? environment.get().jsonSerializer() : opts.serializer();
return SearchAccessor.searchQueryAsync(core, searchRequest(indexName, query, opts), serializer);
}
use of com.couchbase.client.java.codec.JsonSerializer in project couchbase-jvm-clients by couchbase.
the class AsyncCluster method analyticsQuery.
/**
* Performs an Analytics query with custom {@link AnalyticsOptions}.
*
* @param statement the Analytics query statement as a raw string.
* @param options the custom options for this analytics query.
* @return the {@link AnalyticsResult} once the response arrives successfully.
*/
public CompletableFuture<AnalyticsResult> analyticsQuery(final String statement, final AnalyticsOptions options) {
notNull(options, "AnalyticsOptions", () -> new ReducedAnalyticsErrorContext(statement));
AnalyticsOptions.Built opts = options.build();
JsonSerializer serializer = opts.serializer() == null ? environment.get().jsonSerializer() : opts.serializer();
return AnalyticsAccessor.analyticsQueryAsync(core, analyticsRequest(statement, opts), serializer);
}
use of com.couchbase.client.java.codec.JsonSerializer in project couchbase-jvm-clients by couchbase.
the class AsyncCluster method query.
/**
* Performs a N1QL query with custom {@link QueryOptions}.
*
* @param statement the N1QL query statement as a raw string.
* @param options the custom options for this query.
* @return the {@link QueryResult} once the response arrives successfully.
*/
public CompletableFuture<QueryResult> query(final String statement, final QueryOptions options) {
notNull(options, "QueryOptions", () -> new ReducedQueryErrorContext(statement));
final QueryOptions.Built opts = options.build();
JsonSerializer serializer = opts.serializer() == null ? environment.get().jsonSerializer() : opts.serializer();
return queryAccessor.queryAsync(queryRequest(statement, opts), opts, serializer);
}
Aggregations