Query with stopwords executed directly against a type fails, closes #1320.
This commit is contained in:
parent
5610d90c2d
commit
8532dc84e9
|
@ -77,6 +77,9 @@ public final class QueryParsers {
|
||||||
|
|
||||||
public static Query wrapSmartNameQuery(Query query, @Nullable MapperService.SmartNameFieldMappers smartFieldMappers,
|
public static Query wrapSmartNameQuery(Query query, @Nullable MapperService.SmartNameFieldMappers smartFieldMappers,
|
||||||
QueryParseContext parseContext) {
|
QueryParseContext parseContext) {
|
||||||
|
if (query == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (smartFieldMappers == null) {
|
if (smartFieldMappers == null) {
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,11 @@ public class SearchContextException extends SearchException {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append('[').append(context.shardTarget().index()).append("][").append(context.shardTarget().shardId()).append("]: ");
|
sb.append('[').append(context.shardTarget().index()).append("][").append(context.shardTarget().shardId()).append("]: ");
|
||||||
if (context.parsedQuery() != null) {
|
if (context.parsedQuery() != null) {
|
||||||
sb.append("query[").append(context.parsedQuery().query()).append("],");
|
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("]");
|
sb.append("from[").append(context.from()).append("],size[").append(context.size()).append("]");
|
||||||
if (context.sort() != null) {
|
if (context.sort() != null) {
|
||||||
|
|
Loading…
Reference in New Issue