org.elasticsearch.ElasticSearchException



API Populatity

5 Client projects

Project SonarSource/sonarqube in file ....main.java.org.sonar.server.rule.RuleRegistry.java (2014-05-16)
@@ -26,7 +26,6 @@ import com.google.common.collect.ImmutableList.Builder;
 import com.google.common.collect.Multimap;
 import org.apache.commons.lang.StringUtils;
 import org.apache.ibatis.session.SqlSession;
-import org.elasticsearch.ElasticSearchException;
 import org.elasticsearch.action.search.SearchRequestBuilder;
 import org.elasticsearch.action.search.SearchResponse;
 import org.elasticsearch.action.search.SearchType;
@@ -311,15 +310,12 @@ public class RuleRegistry {
       searchQuery.field(param.getKey(), param.getValue().split("\\|"));
     }
 
-    try {
       List<Integer> result = newArrayList();
       for (String docId : searchIndex.findDocumentIds(searchQuery)) {
         result.add(Integer.parseInt(docId));
       }
       return result;
-    } catch (ElasticSearchException searchException) {
-      throw new IllegalArgumentException("Unable to perform search, please check query", searchException);
-    }
+
   }
 
   public PagedResult<Rule> find(RuleQuery query) {
Project elasticsearch/elasticsearch in file ...va.org.elasticsearch.index.query.QueryBuilder.java (2013-11-15)
@@ -19,6 +19,7 @@
 
 package org.elasticsearch.index.query;
 
+import org.elasticsearch.ElasticSearchException;
 import org.elasticsearch.common.bytes.BytesReference;
 import org.elasticsearch.common.xcontent.ToXContent;
 import org.elasticsearch.common.xcontent.XContentType;
@@ -28,7 +29,7 @@ import org.elasticsearch.common.xcontent.XContentType;
  */
 public interface QueryBuilder extends ToXContent {
 
-    BytesReference buildAsBytes() throws QueryBuilderException;
+    BytesReference buildAsBytes() throws ElasticSearchException;
 
-    BytesReference buildAsBytes(XContentType contentType) throws QueryBuilderException;
+    BytesReference buildAsBytes(XContentType contentType) throws ElasticSearchException;
 }
Project elasticsearch/elasticsearch in file ...on.TransportIndicesReplicationOperationAction.java (2012-09-26)
@@ -19,6 +19,7 @@
 
 package org.elasticsearch.action.support.replication;
 
+import org.elasticsearch.ElasticSearchException;
 import org.elasticsearch.action.ActionListener;
 import org.elasticsearch.action.ActionRequest;
 import org.elasticsearch.action.ActionResponse;
@@ -63,6 +64,9 @@ public abstract class TransportIndicesReplicationOperationAction<Request extends
         transportService.registerHandler(transportAction, new TransportHandler());
     }
 
+
+    protected abstract Map<String, Set<String>> resolveRouting(ClusterState clusterState, Request request) throws ElasticSearchException;
+
     @Override
     protected void doExecute(final Request request, final ActionListener<Response> listener) {
         ClusterState clusterState = clusterService.state();
@@ -81,7 +85,7 @@ public abstract class TransportIndicesReplicationOperationAction<Request extends
         final AtomicInteger completionCounter = new AtomicInteger(concreteIndices.length);
         final AtomicReferenceArray<Object> indexResponses = new AtomicReferenceArray<Object>(concreteIndices.length);
 
-        Map<String, Set<String>> routingMap = clusterState.metaData().resolveSearchRouting(request.routing(), request.indices());
+        Map<String, Set<String>> routingMap = resolveRouting(clusterState, request);
 
         for (final String index : concreteIndices) {
             Set<String> routing = null;