Skip to content

Commit

Permalink
Fix wrong error messages in MultiMatchQueryParser.
Browse files Browse the repository at this point in the history
Also fix a typo in the comment

Close #8597
  • Loading branch information
damienalexandre authored and jpountz committed Nov 21, 2014
1 parent 40598a5 commit 8029545
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -34,7 +34,7 @@
import java.util.Map;

/**
* Same ad {@link MatchQueryParser} but has support for multiple fields.
* Same as {@link MatchQueryParser} but has support for multiple fields.
*/
public class MultiMatchQueryParser implements QueryParser {

Expand Down Expand Up @@ -142,11 +142,11 @@ public Query parse(QueryParseContext parseContext) throws IOException, QueryPars
}

if (value == null) {
throw new QueryParsingException(parseContext.index(), "No text specified for match_all query");
throw new QueryParsingException(parseContext.index(), "No text specified for multi_match query");
}

if (fieldNameWithBoosts.isEmpty()) {
throw new QueryParsingException(parseContext.index(), "No fields specified for match_all query");
throw new QueryParsingException(parseContext.index(), "No fields specified for multi_match query");
}
if (type == null) {
type = MultiMatchQueryBuilder.Type.BEST_FIELDS;
Expand Down Expand Up @@ -198,4 +198,4 @@ private void extractFieldAndBoost(QueryParseContext parseContext, XContentParser
fieldNameWithBoosts.put(fField, fBoost);
}
}
}
}

0 comments on commit 8029545

Please sign in to comment.