<logback.version>1.0.13</logback.version>
<slf4j.version>1.7.5</slf4j.version>
<tomcat.version>7.0.42</tomcat.version>
- <elasticsearch.version>0.90.9</elasticsearch.version>
+ <elasticsearch.version>1.1.1</elasticsearch.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.min.version>3.0.5</maven.min.version>
<maven.api.version>2.2.0</maven.api.version>
import com.google.common.collect.Lists;
import org.apache.commons.io.IOUtils;
-import org.elasticsearch.ElasticSearchParseException;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
}
watch = createWatch();
- try {
indices.putMapping(Requests.putMappingRequest(index).type(type).source(mapping)).actionGet();
- } catch (ElasticSearchParseException parseException) {
- throw new IllegalArgumentException("Invalid mapping file", parseException);
- } finally {
+
watch.stop("put mapping on index '%s' for type '%s'", index, type);
- }
+
}
public List<String> findDocumentIds(SearchQuery searchQuery) {
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;
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) {