LUCENE-8242: Remove IndexSearcher.createNormalizedWeight

This commit is contained in:
Alan Woodward 2018-04-09 14:53:27 +01:00
parent 798d351034
commit e30264b314
3 changed files with 9 additions and 16 deletions

View File

@ -38,6 +38,9 @@ API Changes
* LUCENE-8113: TermContext has been renamed to TermStates, and can now be
constructed lazily if term statistics are not required (Alan Woodward)
* LUCENE-8242: Deprecated method IndexSearcher#createNormalizedWeight() has
been removed (Alan Woodward)
Changes in Runtime Behavior
* LUCENE-7837: Indices that were created before the previous major version

View File

@ -37,3 +37,9 @@ Changing index options on the fly is now going to result into an
IllegalArgumentException. If a field is indexed
(FieldType.indexOptions() != IndexOptions.NONE) then all documents must have
the same index options for that field.
## IndexSearcher.createNormalizedWeight() removed (LUCENE-8242) ##
Instead use IndexSearcher.createWeight(), rewriting the query first, and using
a boost of 1f.

View File

@ -679,22 +679,6 @@ public class IndexSearcher {
return weight.explain(ctx, deBasedDoc);
}
/**
* Creates a normalized weight for a top-level {@link Query}.
* The query is rewritten by this method and {@link Query#createWeight} called,
* afterwards the {@link Weight} is normalized. The returned {@code Weight}
* can then directly be used to get a {@link Scorer}.
* @lucene.internal
*
* @deprecated Clients should rewrite the query and then call {@link #createWeight(Query, ScoreMode, float)}
* with a boost value of 1f
*/
@Deprecated
public Weight createNormalizedWeight(Query query, ScoreMode scoreMode) throws IOException {
query = rewrite(query);
return createWeight(query, scoreMode, 1f);
}
/**
* Creates a {@link Weight} for the given query, potentially adding caching
* if possible and configured.