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

Commit

Permalink
Merge pull request #162 from whiter4bbit/master
Browse files Browse the repository at this point in the history
bugfix: replace ignore_indices to corresponding parameters supported in 1.x
  • Loading branch information
Cihat Keser committed Nov 26, 2014
2 parents 369a4b8 + d6d07f2 commit 4bc4d18
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
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

0 comments on commit 4bc4d18

Please sign in to comment.