Skip to content

Commit

Permalink
version 0.3.1 : Adding a simple way to check if a percolator exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mguillermin committed Jun 19, 2012
1 parent b4d0b14 commit 08612fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion module/app/com/github/cleverage/elasticsearch/IndexService.java
Expand Up @@ -281,7 +281,6 @@ public static IndexResponse createPercolator(String namePercolator, QueryBuilder
return percolatorRequest.execute().actionGet();
}


/**
* Create Percolator
*
Expand All @@ -301,6 +300,20 @@ public static IndexResponse createPercolator(String namePercolator, String query
return percolatorRequest.execute().actionGet();
}

/**
* Check if a percolator exists
* @param namePercolator
* @return
*/
public static boolean precolatorExists(String namePercolator) {
try {
GetResponse responseExist = IndexService.getPercolator(namePercolator);
return (responseExist.exists());
} catch (IndexMissingException e) {
return false;
}
}

/**
* Delete Percolator
*
Expand Down
2 changes: 1 addition & 1 deletion module/project/Build.scala
Expand Up @@ -5,7 +5,7 @@ import PlayProject._
object ApplicationBuild extends Build {

val appName = "elasticsearch"
val appVersion = "0.3"
val appVersion = "0.3.1"

val appDependencies = Seq(
// Add your project dependencies here
Expand Down

0 comments on commit 08612fc

Please sign in to comment.