Fix wrong error messages in MultiMatchQueryParser.

Also fix a typo in the comment

Close #8597
This commit is contained in:
Damien Alexandre 2014-11-21 17:47:44 +01:00 committed by Adrien Grand
parent 40598a5692
commit 80295458ad
1 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ import java.io.IOException;
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 {
@ -142,11 +142,11 @@ public class MultiMatchQueryParser implements QueryParser {
}
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;
@ -198,4 +198,4 @@ public class MultiMatchQueryParser implements QueryParser {
fieldNameWithBoosts.put(fField, fBoost);
}
}
}
}