summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java
diff options
context:
space:
mode:
authorAreek Zillur <areek.zillur@elasticsearch.com>2016-02-10 16:21:24 -0500
committerAreek Zillur <areek.zillur@elasticsearch.com>2016-02-10 16:21:55 -0500
commit2038429f63cd31721c0522d2d49eab66303c68fb (patch)
tree1deac75ae674b0d33bfc45008347d6926f2b7c03 /core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java
parentbbeb09eae7ac3c5d9837bb26eacfac6bba468929 (diff)
initial refactoring of completion suggester
Diffstat (limited to 'core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java')
-rw-r--r--core/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java8
1 files changed, 4 insertions, 4 deletions
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<QueryContext> 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;