From 2038429f63cd31721c0522d2d49eab66303c68fb Mon Sep 17 00:00:00 2001 From: Areek Zillur Date: Wed, 10 Feb 2016 16:21:24 -0500 Subject: initial refactoring of completion suggester --- .../search/suggest/completion/context/CategoryContextMapping.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java') diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java index dffbb1aa80..10ac3935cc 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java @@ -158,12 +158,12 @@ public class CategoryContextMapping extends ContextMapping { List queryContexts = new ArrayList<>(); Token token = parser.nextToken(); if (token == Token.START_OBJECT || token == Token.VALUE_STRING) { - CategoryQueryContext parse = CategoryQueryContext.parse(parser); - queryContexts.add(new QueryContext(parse.getCategory().toString(), parse.getBoost(), parse.isPrefix())); + CategoryQueryContext parse = CategoryQueryContext.PROTOTYPE.fromXContext(parser); + queryContexts.add(new QueryContext(parse.getCategory(), parse.getBoost(), parse.isPrefix())); } else if (token == Token.START_ARRAY) { while (parser.nextToken() != Token.END_ARRAY) { - CategoryQueryContext parse = CategoryQueryContext.parse(parser); - queryContexts.add(new QueryContext(parse.getCategory().toString(), parse.getBoost(), parse.isPrefix())); + CategoryQueryContext parse = CategoryQueryContext.PROTOTYPE.fromXContext(parser); + queryContexts.add(new QueryContext(parse.getCategory(), parse.getBoost(), parse.isPrefix())); } } return queryContexts; -- cgit v1.2.3