Merge pull request #10592 from cbuescher/remove-matchall-norms
Remove unused normsField from MatchAllQuery
This commit is contained in:
commit
eac922b73b
|
@ -30,18 +30,8 @@ import java.io.IOException;
|
|||
*/
|
||||
public class MatchAllQueryBuilder extends BaseQueryBuilder implements BoostableQueryBuilder<MatchAllQueryBuilder> {
|
||||
|
||||
private String normsField;
|
||||
|
||||
private float boost = -1;
|
||||
|
||||
/**
|
||||
* Field used for normalization factor (document boost). Defaults to no field.
|
||||
*/
|
||||
public MatchAllQueryBuilder normsField(String normsField) {
|
||||
this.normsField = normsField;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the boost for this query. Documents matching this query will (in addition to the normal
|
||||
* weightings) have their score multiplied by the boost provided.
|
||||
|
@ -58,9 +48,6 @@ public class MatchAllQueryBuilder extends BaseQueryBuilder implements BoostableQ
|
|||
if (boost != -1) {
|
||||
builder.field("boost", boost);
|
||||
}
|
||||
if (normsField != null) {
|
||||
builder.field("norms_field", normsField);
|
||||
}
|
||||
builder.endObject();
|
||||
}
|
||||
}
|
|
@ -68,8 +68,6 @@ public class MatchAllQueryParser implements QueryParser {
|
|||
return Queries.newMatchAllQuery();
|
||||
}
|
||||
|
||||
//LUCENE 4 UPGRADE norms field is not supported anymore need to find another way or drop the functionality
|
||||
//MatchAllDocsQuery query = new MatchAllDocsQuery(normsField);
|
||||
MatchAllDocsQuery query = new MatchAllDocsQuery();
|
||||
query.setBoost(boost);
|
||||
return query;
|
||||
|
|
|
@ -147,7 +147,7 @@ public class FullRestartStressTest {
|
|||
// verify search
|
||||
for (int i = 0; i < (nodes.length * 5); i++) {
|
||||
// do a search with norms field, so we don't rely on match all filtering cache
|
||||
SearchResponse search = client.client().prepareSearch().setQuery(matchAllQuery().normsField("field")).execute().actionGet();
|
||||
SearchResponse search = client.client().prepareSearch().setQuery(matchAllQuery()).execute().actionGet();
|
||||
logger.debug("index_count [{}], expected_count [{}]", search.getHits().totalHits(), indexCounter.get());
|
||||
if (count.getCount() != indexCounter.get()) {
|
||||
logger.warn("!!! search does not match, index_count [{}], expected_count [{}]", search.getHits().totalHits(), indexCounter.get());
|
||||
|
|
Loading…
Reference in New Issue