private static String getQueryParameters(SearchRequest request) { final StringBuilder queryParams = new StringBuilder(); if (request.routing() != null) { queryParams.append("routing=").append(request.routing()); } if (request.searchType() != SearchType.DEFAULT) { queryParams.append("search_type=").append(request.searchType().name().toLowerCase()); } if (queryParams.length() > 0) { queryParams.insert(0, '?'); } return queryParams.toString(); }
private static void addSearchRequestParams(Params params, SearchRequest searchRequest) { params.putParam("typed_keys", "true"); params.withRouting(searchRequest.routing()); params.withPreference(searchRequest.preference()); params.withIndicesOptions(searchRequest.indicesOptions()); params.putParam("search_type", searchRequest.searchType().name().toLowerCase(Locale.ROOT)); if (searchRequest.requestCache() != null) { params.putParam("request_cache", Boolean.toString(searchRequest.requestCache())); } if (searchRequest.allowPartialSearchResults() != null) { params.putParam("allow_partial_search_results", Boolean.toString(searchRequest.allowPartialSearchResults())); } params.putParam("batched_reduce_size", Integer.toString(searchRequest.getBatchedReduceSize())); if (searchRequest.scroll() != null) { params.putParam("scroll", searchRequest.scroll().keepAlive()); } }
/** * A comma separated list of routing values to control the shards the search will be executed on. */ public SearchRequestBuilder setRouting(String routing) { request.routing(routing); return this; }
/** * The routing values to control the shards that the search will be executed on. */ public SearchRequestBuilder setRouting(String... routing) { request.routing(routing); return this; }
/** * Set routing limiting the process to the shards that match that routing value */ public UpdateByQueryRequest setRouting(String routing) { if (routing != null) { getSearchRequest().routing(routing); } return this; }
/** * Gets the routing value used for this request */ public String getRouting() { return getSearchRequest().routing(); }
/** * Set routing limiting the process to the shards that match that routing value */ public DeleteByQueryRequest setRouting(String routing) { if (routing != null) { getSearchRequest().routing(routing); } return this; }
/** * Gets the routing value used for this request */ public String getRouting() { return getSearchRequest().routing(); }
searchRequest.routing(routing); searchRequest.preference(nodeStringValue(value, null)); } else if ("routing".equals(entry.getKey())) { searchRequest.routing(nodeStringValue(value, null)); } else if ("allow_partial_search_results".equals(entry.getKey())) { searchRequest.allowPartialSearchResults(nodeBooleanValue(value, null));
} else { remoteClusterService.collectSearchShards(searchRequest.indicesOptions(), searchRequest.preference(), searchRequest.routing(), remoteClusterIndices, ActionListener.wrap((searchShardsResponses) -> { List<SearchShardIterator> remoteShardIterators = new ArrayList<>(); Map<String, AliasFilter> remoteAliasFilters = new HashMap<>();
/** * A comma separated list of routing values to control the shards the search will be executed on. */ public SearchRequestBuilder setRouting(String routing) { request.routing(routing); return this; }
/** * A comma separated list of routing values to control the shards the search will be executed on. */ public SearchRequestBuilder setRouting(String routing) { request.routing(routing); return this; }
/** * The routing values to control the shards that the search will be executed on. */ public SearchRequestBuilder setRouting(String... routing) { request.routing(routing); return this; }
Map<String, Set<String>> routingMap = indexNameExpressionResolver.resolveSearchRouting(clusterState, searchRequest.routing(), searchRequest.indices()); routingMap = routingMap == null ? Collections.emptyMap() : Collections.unmodifiableMap(routingMap);
/** * Gets the routing value used for this request */ public String getRouting() { return getSearchRequest().routing(); }
/** * Set routing limiting the process to the shards that match that routing value */ public DeleteByQueryRequest setRouting(String routing) { if (routing != null) { getSearchRequest().routing(routing); } return this; }
/** * Gets the routing value used for this request */ public String getRouting() { return getSearchRequest().routing(); }
countRequest.routing(request.param("routing")); float minScore = request.paramAsFloat("min_score", -1f); if (minScore != -1f) {
searchRequest.routing(request.param("routing")); searchRequest.preference(request.param("preference")); searchRequest.indicesOptions(IndicesOptions.fromRequest(request, searchRequest.indicesOptions()));