Skip to content

Commit

Permalink
Merge pull request #19 from emmanuel-keller/master
Browse files Browse the repository at this point in the history
Implements #18
  • Loading branch information
emmanuel-keller committed Feb 5, 2015
2 parents b9bb8e1 + 88a02a6 commit b2c950a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,22 @@ public static enum OperatorEnum {
public Boolean enableLog;
public List<String> customLogs;

public static enum BatchAction {

/**
* The batch is stopped if the request found documents. IF not document
* was found, the batch execute the next request.
*/
STOP_IF_FOUND,

/**
* Go to the next request even if the request found documents.
*/
CONTINUE
}

public BatchAction batchAction;

public SearchQueryAbstract() {
query = null;
start = null;
Expand All @@ -93,6 +109,7 @@ public SearchQueryAbstract() {
enableLog = null;
customLogs = null;
emptyReturnsAll = null;
batchAction = null;
}

/**
Expand Down Expand Up @@ -377,4 +394,12 @@ public SearchQueryAbstract setCustomLogs(List<String> customLogs) {
return this;
}

/**
* @param batchAction
* the batchAction to set
*/
public SearchQueryAbstract setBatchAction(BatchAction batchAction) {
this.batchAction = batchAction;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,20 @@
public class SearchQueryBatch {

public static enum QueryModeEnum {
all, first
/**
* All queries are executed
*/
all,

/**
* The batch is stopped when a query found a result
*/
first,

/**
* The behavior is managed by the batchAction parameter for each query
*/
manual
}

public QueryModeEnum mode;
Expand Down Expand Up @@ -73,7 +86,7 @@ public SearchQueryBatch addQuery(List<SearchQueryAbstract> queries) {
return this;
}

public SearchQueryBatch seMode(QueryModeEnum mode) {
public SearchQueryBatch setMode(QueryModeEnum mode) {
this.mode = mode;
return this;
}
Expand Down

0 comments on commit b2c950a

Please # to comment.