Fix wrong error messages in MultiMatchQueryParser.
Also fix a typo in the comment Close #8597
This commit is contained in:
parent
40598a5692
commit
80295458ad
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue