Query with stopwords executed directly against a type fails, closes #1320.

This commit is contained in:
Shay Banon 2011-09-11 00:53:39 +03:00
parent 5610d90c2d
commit 8532dc84e9
2 changed files with 8 additions and 1 deletions

View File

@ -77,6 +77,9 @@ public final class QueryParsers {
public static Query wrapSmartNameQuery(Query query, @Nullable MapperService.SmartNameFieldMappers smartFieldMappers,
QueryParseContext parseContext) {
if (query == null) {
return null;
}
if (smartFieldMappers == null) {
return query;
}

View File

@ -38,7 +38,11 @@ public class SearchContextException extends SearchException {
StringBuilder sb = new StringBuilder();
sb.append('[').append(context.shardTarget().index()).append("][").append(context.shardTarget().shardId()).append("]: ");
if (context.parsedQuery() != null) {
try {
sb.append("query[").append(context.parsedQuery().query()).append("],");
} catch (Exception e) {
sb.append("query[_failed_to_string_],");
}
}
sb.append("from[").append(context.from()).append("],size[").append(context.size()).append("]");
if (context.sort() != null) {