_indices = new ArrayList<>(Arrays.asList(resolver.concreteIndexNames(state, IndicesOptions.fromOptions(false, true, true, false), requestedPatterns))); if (log.isDebugEnabled()) { log.debug("Resolved pattern {} to {}", requestedPatterns, _indices);
protected void updateRequestWithIndexAndRoutingOptions(Select select, SearchRequestBuilder request) { for (Hint hint : select.getHints()) { if (hint.getType() == HintType.IGNORE_UNAVAILABLE) { //saving the defaults from TransportClient search request.setIndicesOptions(IndicesOptions.fromOptions(true, false, true, false, IndicesOptions.strictExpandOpenAndForbidClosed())); } if (hint.getType() == HintType.ROUTINGS) { Object[] routings = hint.getParams(); String[] routingsAsStringArray = new String[routings.length]; for (int i = 0; i < routings.length; i++) { routingsAsStringArray[i] = routings[i].toString(); } request.setRouting(routingsAsStringArray); } } }
public static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices) { return fromOptions(ignoreUnavailable, allowNoIndices, expandToOpenIndices, expandToClosedIndices, true, false, false, false); }
/** * Constructs a new validate request against the provided indices. No indices provided means it will * run against all indices. */ public ValidateQueryRequest(String... indices) { super(indices); indicesOptions(IndicesOptions.fromOptions(false, false, true, false)); }
public IndicesExistsRequest expandWilcardsOpen(boolean expandWildcardsOpen) { this.indicesOptions = IndicesOptions.fromOptions(indicesOptions.ignoreUnavailable(), indicesOptions.allowNoIndices(), expandWildcardsOpen, indicesOptions.expandWildcardsClosed()); return this; }
public IndicesExistsRequest expandWilcardsClosed(boolean expandWildcardsClosed) { this.indicesOptions = IndicesOptions.fromOptions(indicesOptions.ignoreUnavailable(), indicesOptions.allowNoIndices(), indicesOptions.expandWildcardsOpen(), expandWildcardsClosed); return this; }
public static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices, IndicesOptions defaultOptions) { return fromOptions(ignoreUnavailable, allowNoIndices, expandToOpenIndices, expandToClosedIndices, defaultOptions.allowAliasesToMultipleIndices(), defaultOptions.forbidClosedIndices(), defaultOptions.ignoreAliases(), defaultOptions.ignoreThrottled()); }
public static IndicesOptions fromParameters(Object wildcardsString, Object ignoreUnavailableString, Object allowNoIndicesString, Object ignoreThrottled, IndicesOptions defaultSettings) { if (wildcardsString == null && ignoreUnavailableString == null && allowNoIndicesString == null && ignoreThrottled == null) { return defaultSettings; } EnumSet<WildcardStates> wildcards = WildcardStates.parseParameter(wildcardsString, defaultSettings.expandWildcards); // note that allowAliasesToMultipleIndices is not exposed, always true (only for internal use) return fromOptions( nodeBooleanValue(ignoreUnavailableString, "ignore_unavailable", defaultSettings.ignoreUnavailable()), nodeBooleanValue(allowNoIndicesString, "allow_no_indices", defaultSettings.allowNoIndices()), wildcards.contains(WildcardStates.OPEN), wildcards.contains(WildcardStates.CLOSED), defaultSettings.allowAliasesToMultipleIndices(), defaultSettings.forbidClosedIndices(), defaultSettings.ignoreAliases(), nodeBooleanValue(ignoreThrottled, "ignore_throttled", defaultSettings.ignoreThrottled()) ); }
@Override protected ClusterBlockException checkBlock(IndicesExistsRequest request, ClusterState state) { //make sure through indices options that the concrete indices call never throws IndexMissingException IndicesOptions indicesOptions = IndicesOptions.fromOptions(true, true, request.indicesOptions().expandWildcardsOpen(), request.indicesOptions().expandWildcardsClosed()); return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_READ, indexNameExpressionResolver.concreteIndexNames(state, indicesOptions, request.indices())); }
@Override protected ClusterBlockException checkBlock(RolloverRequest request, ClusterState state) { IndicesOptions indicesOptions = IndicesOptions.fromOptions(true, true, request.indicesOptions().expandWildcardsOpen(), request.indicesOptions().expandWildcardsClosed()); return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_WRITE, indexNameExpressionResolver.concreteIndexNames(state, indicesOptions, request.indices())); }
/** * Constructs a new validate request against the provided indices. No indices provided means it will * run against all indices. */ public ValidateQueryRequest(String... indices) { super(indices); indicesOptions(IndicesOptions.fromOptions(false, false, true, false)); }
/** * Constructs a new validate request against the provided indices. No indices provided means it will * run against all indices. */ public ValidateQueryRequest(String... indices) { super(indices); indicesOptions(IndicesOptions.fromOptions(false, false, true, false)); }
public IndicesExistsRequest expandWilcardsClosed(boolean expandWildcardsClosed) { this.indicesOptions = IndicesOptions.fromOptions(indicesOptions.ignoreUnavailable(), indicesOptions.allowNoIndices(), indicesOptions.expandWildcardsOpen(), expandWildcardsClosed); return this; }
public IndicesExistsRequest expandWilcardsClosed(boolean expandWildcardsClosed) { this.indicesOptions = IndicesOptions.fromOptions(indicesOptions.ignoreUnavailable(), indicesOptions.allowNoIndices(), indicesOptions.expandWildcardsOpen(), expandWildcardsClosed); return this; }
public IndicesExistsRequest expandWilcardsOpen(boolean expandWildcardsOpen) { this.indicesOptions = IndicesOptions.fromOptions(indicesOptions.ignoreUnavailable(), indicesOptions.allowNoIndices(), expandWildcardsOpen, indicesOptions.expandWildcardsClosed()); return this; }
@Override protected ClusterBlockException checkBlock(IndicesExistsRequest request, ClusterState state) { //make sure through indices options that the concrete indices call never throws IndexMissingException IndicesOptions indicesOptions = IndicesOptions.fromOptions(true, true, request.indicesOptions().expandWildcardsOpen(), request.indicesOptions().expandWildcardsClosed()); return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_READ, indexNameExpressionResolver.concreteIndexNames(state, indicesOptions, request.indices())); }
@Override protected ClusterBlockException checkBlock(RolloverRequest request, ClusterState state) { IndicesOptions indicesOptions = IndicesOptions.fromOptions(true, true, request.indicesOptions().expandWildcardsOpen(), request.indicesOptions().expandWildcardsClosed()); return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_WRITE, indexNameExpressionResolver.concreteIndexNames(state, indicesOptions, request.indices())); }
@Override protected ClusterBlockException checkBlock(RolloverRequest request, ClusterState state) { IndicesOptions indicesOptions = IndicesOptions.fromOptions(true, true, request.indicesOptions().expandWildcardsOpen(), request.indicesOptions().expandWildcardsClosed()); return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_WRITE, indexNameExpressionResolver.concreteIndexNames(state, indicesOptions, request.indices())); }
@Override protected ClusterBlockException checkBlock(IndicesExistsRequest request, ClusterState state) { //make sure through indices options that the concrete indices call never throws IndexMissingException IndicesOptions indicesOptions = IndicesOptions.fromOptions(true, true, request.indicesOptions().expandWildcardsOpen(), request.indicesOptions().expandWildcardsClosed()); return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_READ, indexNameExpressionResolver.concreteIndexNames(state, indicesOptions, request.indices())); }
@Override protected ClusterBlockException checkBlock(RolloverRequest request, ClusterState state) { IndicesOptions indicesOptions = IndicesOptions.fromOptions(true, true, request.indicesOptions().expandWildcardsOpen(), request.indicesOptions().expandWildcardsClosed()); return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_WRITE, indexNameExpressionResolver.concreteIndexNames(state, indicesOptions, request.indices())); }