Skip to content

Commit

Permalink
Percolator Index: Don't index the query element in a percolated que…
Browse files Browse the repository at this point in the history
…ry, closes elastic#1949.
  • Loading branch information
kimchy committed May 13, 2012
1 parent ac3479c commit 6035298
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -148,6 +148,21 @@ public ClusterState execute(ClusterState currentState) {

// add the request mapping
Map<String, Map<String, Object>> mappings = Maps.newHashMap();

// if its a _percolator index, don't index the query object
if (request.index.equals(PercolatorService.INDEX_NAME)) {
mappings.put(MapperService.DEFAULT_MAPPING, parseMapping("{\n" +
" \"_default_\":{\n" +
" \"properties\" : {\n" +
" \"query\" : {\n" +
" \"type\" : \"object\",\n" +
" \"enabled\" : false\n" +
" }\n" +
" }\n" +
" }\n" +
"}"));
}

for (Map.Entry<String, String> entry : request.mappings.entrySet()) {
mappings.put(entry.getKey(), parseMapping(entry.getValue()));
}
Expand Down

0 comments on commit 6035298

Please sign in to comment.