Skip to content

Commit

Permalink
Query with stopwords executed directly against a type fails, closes e…
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Sep 10, 2011
1 parent eecc7ab commit 4799bed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Expand Up @@ -77,6 +77,9 @@ public static MultiTermQuery.RewriteMethod parseRewriteMethod(@Nullable String r

public static Query wrapSmartNameQuery(Query query, @Nullable MapperService.SmartNameFieldMappers smartFieldMappers,
QueryParseContext parseContext) {
if (query == null) {
return null;
}
if (smartFieldMappers == null) {
return query;
}
Expand Down
Expand Up @@ -38,7 +38,11 @@ private static String buildMessage(SearchContext context, String msg) {
StringBuilder sb = new StringBuilder();
sb.append('[').append(context.shardTarget().index()).append("][").append(context.shardTarget().shardId()).append("]: ");
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("]");
if (context.sort() != null) {
Expand Down

0 comments on commit 4799bed

Please sign in to comment.