parent
f33e353259
commit
edaa65dba2
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.index.query;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.lucene.search.BooleanClause;
|
||||
import org.apache.lucene.search.BooleanQuery;
|
||||
|
@ -33,7 +32,6 @@ import org.elasticsearch.index.search.MatchQuery;
|
|||
import org.elasticsearch.index.search.MultiMatchQuery;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -146,7 +144,7 @@ public class MultiMatchQueryParser implements QueryParser {
|
|||
} else if ("use_dis_max".equals(currentFieldName) || "useDisMax".equals(currentFieldName)) {
|
||||
multiMatchQuery.setUseDisMax(parser.booleanValue());
|
||||
} else if ("tie_breaker".equals(currentFieldName) || "tieBreaker".equals(currentFieldName)) {
|
||||
multiMatchQuery.setTieBreaker(parser.intValue());
|
||||
multiMatchQuery.setTieBreaker(parser.floatValue());
|
||||
} else if ("lenient".equals(currentFieldName)) {
|
||||
multiMatchQuery.setLenient(parser.booleanValue());
|
||||
} else {
|
||||
|
|
|
@ -25,19 +25,18 @@ import org.apache.lucene.search.DisjunctionMaxQuery;
|
|||
import org.apache.lucene.search.Query;
|
||||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class MultiMatchQuery extends MatchQuery {
|
||||
|
||||
private boolean useDisMax = true;
|
||||
private int tieBreaker;
|
||||
private float tieBreaker;
|
||||
|
||||
public void setUseDisMax(boolean useDisMax) {
|
||||
this.useDisMax = useDisMax;
|
||||
}
|
||||
|
||||
public void setTieBreaker(int tieBreaker) {
|
||||
public void setTieBreaker(float tieBreaker) {
|
||||
this.tieBreaker = tieBreaker;
|
||||
}
|
||||
|
||||
|
@ -85,7 +84,7 @@ public class MultiMatchQuery extends MatchQuery {
|
|||
booleanQuery.add(query, BooleanClause.Occur.SHOULD);
|
||||
}
|
||||
}
|
||||
return !booleanQuery.clauses().isEmpty() ? booleanQuery : null;
|
||||
return !booleanQuery.clauses().isEmpty() ? booleanQuery : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue