@Override public String explain() { try { XContentBuilder firstBuilder = XContentFactory.contentBuilder(XContentType.JSON).prettyPrint(); this.firstSearchRequest.request().source().toXContent(firstBuilder, ToXContent.EMPTY_PARAMS); XContentBuilder secondBuilder = XContentFactory.contentBuilder(XContentType.JSON).prettyPrint(); this.secondSearchRequest.request().source().toXContent(secondBuilder, ToXContent.EMPTY_PARAMS); String explained = String.format("performing %s on :\n left query:\n%s\n right query:\n%s", this.relation.name, BytesReference.bytes(firstBuilder).utf8ToString(), BytesReference.bytes(secondBuilder).utf8ToString()); return explained; } catch (IOException e) { e.printStackTrace(); } return null; }
@Override public String explain() { try { XContentBuilder firstBuilder = XContentFactory.contentBuilder(XContentType.JSON).prettyPrint(); firstTable.getRequestBuilder().request().source().toXContent(firstBuilder, ToXContent.EMPTY_PARAMS); XContentBuilder secondBuilder = XContentFactory.contentBuilder(XContentType.JSON).prettyPrint(); secondTable.getRequestBuilder().request().source().toXContent(secondBuilder, ToXContent.EMPTY_PARAMS); String explained = String.format(" first query:\n%s\n second query:\n%s", BytesReference.bytes(firstBuilder).utf8ToString(), BytesReference.bytes(secondBuilder).utf8ToString()); return explained; } catch (IOException e) { e.printStackTrace(); } return null; }
/** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. */ public MultiSearchRequest add(SearchRequestBuilder request) { requests.add(request.request()); return this; }
private DeleteByQueryRequestBuilder(ElasticsearchClient client, Action<DeleteByQueryRequest, BulkByScrollResponse, DeleteByQueryRequestBuilder> action, SearchRequestBuilder search) { super(client, action, search, new DeleteByQueryRequest(search.request())); }
/** * Specifies what type of requested indices to ignore and wildcard indices expressions. * <p> * For example indices that don't exist. */ public SearchRequestBuilder setIndicesOptions(IndicesOptions indicesOptions) { request().indicesOptions(indicesOptions); return this; }
private UpdateByQueryRequestBuilder(ElasticsearchClient client, Action<UpdateByQueryRequest, BulkByScrollResponse, UpdateByQueryRequestBuilder> action, SearchRequestBuilder search) { super(client, action, search, new UpdateByQueryRequest(search.request())); }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, BulkByScrollResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
/** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. */ public MultiSearchRequestBuilder add(SearchRequestBuilder request) { if (request.request().indicesOptions() == SearchRequest.DEFAULT_INDICES_OPTIONS && request().indicesOptions() != SearchRequest.DEFAULT_INDICES_OPTIONS) { request.request().indicesOptions(request().indicesOptions()); } super.request.add(request); return this; }
/** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. */ public MultiSearchRequest add(SearchRequestBuilder request) { requests.add(request.request()); return this; }
/** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. */ public MultiSearchRequest add(SearchRequestBuilder request) { requests.add(request.request()); return this; }
private DeleteByQueryRequestBuilder(ElasticsearchClient client, Action<DeleteByQueryRequest, BulkByScrollResponse, DeleteByQueryRequestBuilder> action, SearchRequestBuilder search) { super(client, action, search, new DeleteByQueryRequest(search.request())); }
private UpdateByQueryRequestBuilder(ElasticsearchClient client, Action<UpdateByQueryRequest, BulkIndexByScrollResponse, UpdateByQueryRequestBuilder> action, SearchRequestBuilder search) { super(client, action, search, new UpdateByQueryRequest(search.request())); }
private DeleteByQueryRequestBuilder(ElasticsearchClient client, Action<DeleteByQueryRequest, BulkByScrollResponse, DeleteByQueryRequestBuilder> action, SearchRequestBuilder search) { super(client, action, search, new DeleteByQueryRequest(search.request())); }
/** * Specifies what type of requested indices to ignore and wildcard indices expressions. * <p> * For example indices that don't exist. */ public SearchRequestBuilder setIndicesOptions(IndicesOptions indicesOptions) { request().indicesOptions(indicesOptions); return this; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, BulkByScrollResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, ReindexResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, ReindexResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
/** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. */ public MultiSearchRequestBuilder add(SearchRequestBuilder request) { if (request.request().indicesOptions() == IndicesOptions.strictExpandOpenAndForbidClosed() && request().indicesOptions() != IndicesOptions.strictExpandOpenAndForbidClosed()) { request.request().indicesOptions(request().indicesOptions()); } super.request.add(request); return this; }
/** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. */ public MultiSearchRequestBuilder add(SearchRequestBuilder request) { if (request.request().indicesOptions() == IndicesOptions.strictExpandOpenAndForbidClosed() && request().indicesOptions() != IndicesOptions.strictExpandOpenAndForbidClosed()) { request.request().indicesOptions(request().indicesOptions()); } super.request.add(request); return this; }
/** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. */ public MultiSearchRequestBuilder add(SearchRequestBuilder request) { if (request.request().indicesOptions() == IndicesOptions.strictExpandOpenAndForbidClosed() && request().indicesOptions() != IndicesOptions.strictExpandOpenAndForbidClosed()) { request.request().indicesOptions(request().indicesOptions()); } super.request.add(request); return this; }