Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

replace ignore_indices to corresponding parameters supported in 1.x #162

Merged
merged 1 commit into from
Nov 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@ public K addIndex(Collection<? extends String> indexNames) {
}

/**
* All multi indices API support the ignore_indices option.
* Setting it to missing will cause indices that do not exists
* to be ignored from the execution. By default, when its not
* set, the request will fail.
*
* @param ignoreIndices "none" (No indices / aliases will be excluded from a request) or
* "missing" (Indices / aliases that are missing will be excluded from a request.)
* Ignore unavailable indices, this includes indices that not exists or closed indices.
* @param ignore whether to ignore unavailable indices
*/
public K ignoreIndices(String ignoreIndices) {
setParameter(Parameters.IGNORE_INDICES, ignoreIndices);
public K ignoreUnavailable(boolean ignore) {
setParameter(Parameters.IGNORE_UNAVAILABLE, String.valueOf(ignore));
return (K) this;
}

/**
* Fail of wildcard indices expressions results into no concrete indices.
* @param allow whether to allow no indices.
*/
public K allowNoIndices(boolean allow) {
setParameter(Parameters.ALLOW_NO_INDICES, String.valueOf(allow));
return (K) this;
}

Expand Down
7 changes: 5 additions & 2 deletions jest-common/src/main/java/io/searchbox/params/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ private Parameters() {
// 'camelCase'
public static final String RESULT_CASING = "case";

// 'none' | 'missing'
public static final String IGNORE_INDICES = "ignore_indices";
// 'true' | 'false'
public static final String IGNORE_UNAVAILABLE = "ignore_unavailable";

// 'true' | 'false'
public static final String ALLOW_NO_INDICES = "allow_no_indices";

//'quorum' | 'one' | 'all'
public static final String CONSISTENCY = "consistency";
Expand Down