From eacbd8f88d0d6080202b92e1329450d3abfb789b Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 4 Dec 2013 01:11:24 +0100 Subject: [PATCH] Fixed parsing bug in percolator, where everything after the `doc` object was skipped. Closes #4325 --- .../java/org/elasticsearch/percolator/PercolatorService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/elasticsearch/percolator/PercolatorService.java b/src/main/java/org/elasticsearch/percolator/PercolatorService.java index a132548c81d..7d274398368 100644 --- a/src/main/java/org/elasticsearch/percolator/PercolatorService.java +++ b/src/main/java/org/elasticsearch/percolator/PercolatorService.java @@ -263,6 +263,8 @@ public class PercolatorService extends AbstractComponent { MapperService mapperService = documentIndexService.mapperService(); DocumentMapper docMapper = mapperService.documentMapperWithAutoCreate(request.documentType()); doc = docMapper.parse(source(parser).type(request.documentType()).flyweight(true)); + // the document parsing exists the "doc" object, so we need to set the new current field. + currentFieldName = parser.currentName(); } } else if (token == XContentParser.Token.START_OBJECT) { SearchParseElement element = hlElements.get(currentFieldName);