From f73a5e62d322d289610d1345e984ae0d89105fd3 Mon Sep 17 00:00:00 2001 From: kimchy Date: Wed, 29 Dec 2010 18:55:37 +0200 Subject: [PATCH] improve error message --- .../index/query/xcontent/QueryParseContext.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryParseContext.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryParseContext.java index af191993d3f..b0ff9381afb 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryParseContext.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryParseContext.java @@ -162,7 +162,7 @@ public class QueryParseContext { XContentQueryParser queryParser = indexQueryParser.queryParser(queryName); if (queryParser == null) { - throw new QueryParsingException(index, "No query parser registered for [" + queryName + "]"); + throw new QueryParsingException(index, "No query registered for [" + queryName + "]"); } Query result = queryParser.parse(this); if (parser.currentToken() == XContentParser.Token.END_OBJECT || parser.currentToken() == XContentParser.Token.END_ARRAY) { @@ -181,14 +181,14 @@ public class QueryParseContext { } token = parser.nextToken(); assert token == XContentParser.Token.FIELD_NAME; - String queryName = parser.currentName(); + String filterName = parser.currentName(); // move to the next START_OBJECT or START_ARRAY token = parser.nextToken(); assert token == XContentParser.Token.START_OBJECT || token == XContentParser.Token.START_ARRAY; - XContentFilterParser filterParser = indexQueryParser.filterParser(queryName); + XContentFilterParser filterParser = indexQueryParser.filterParser(filterName); if (filterParser == null) { - throw new QueryParsingException(index, "No query parser registered for [" + queryName + "]"); + throw new QueryParsingException(index, "No filter registered for [" + filterName + "]"); } Filter result = filterParser.parse(this); if (parser.currentToken() == XContentParser.Token.END_OBJECT || parser.currentToken() == XContentParser.Token.END_ARRAY) {