Adressing review comments

This commit is contained in:
Christoph Büscher 2016-07-29 20:28:17 +02:00
parent 4450039cf6
commit 0d7c289f4c
3 changed files with 12 additions and 17 deletions

View File

@ -745,8 +745,7 @@ public class MultiMatchQueryBuilder extends AbstractQueryBuilder<MultiMatchQuery
Map<String, Float> newFieldsBoosts = handleFieldsMatchPattern(context.getMapperService(), fieldsBoosts);
Query query = multiMatchQuery.parse(type, newFieldsBoosts, value, minimumShouldMatch);
return query;
return multiMatchQuery.parse(type, newFieldsBoosts, value, minimumShouldMatch);
}
private static Map<String, Float> handleFieldsMatchPattern(MapperService mapperService, Map<String, Float> fieldsBoosts) {

View File

@ -37,7 +37,6 @@ import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.lucene.search.MatchNoDocsQuery;
import org.elasticsearch.common.lucene.search.MultiPhrasePrefixQuery;
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.common.unit.Fuzziness;
@ -355,9 +354,6 @@ public class MatchQuery {
if (query instanceof FuzzyQuery) {
QueryParsers.setRewriteMethod((FuzzyQuery) query, fuzzyRewriteMethod);
}
if (query == null) {
return new MatchNoDocsQuery("could not create fuzzy query for field type " + fieldType.name());
}
return query;
} catch (RuntimeException e) {
if (lenient) {