blob: 06e6a814f121d24a6ea7fb886f01dfe801dd0610 [file] [log] [blame]
# Apache Lucene Migration Guide
## Query.hashCode and Query.equals are now abstract methods (LUCENE-7277)
Any custom query subclasses should redeclare equivalence relationship according
to the subclass's details. See code patterns used in existing core Lucene query
classes for details.
## CompressionTools removed (LUCENE-7322)
Per-field compression has been superseded by codec-level compression, which has
the benefit of being able to compress several fields, or even documents at once,
yielding better compression ratios. In case you would still like to compress on
top of the codec, you can do it on the application side by using the utility
classes from the java.util.zip package.
## Explanation.toHtml() removed (LUCENE-7360)
Clients wishing to render Explanations as HTML should implement their own
utilities for this.
## Similarity.coord and BooleanQuery.disableCoord removed (LUCENE-7369)
Coordination factors were a workaround for the fact that the ClassicSimilarity
does not have strong enough term frequency saturation. This causes disjunctions
to get better scores on documents that have many occurrences of a few query
terms than on documents that match most clauses, which is most of time
undesirable. The new BM25Similarity does not suffer from this problem since it
has better saturation for the contribution of the term frequency so the coord
factors have been removed from scores. Things now work as if coords were always
disabled when constructing boolean queries.
## Weight.getValueForNormalization() and Weight.normalize() removed (LUCENE-7368)
Query normalization's goal was to make scores comparable across queries, which
was only implemented by the ClassicSimilarity. Since ClassicSimilarity is not
the default similarity anymore, this functionality has been removed. Boosts are
now propagated through Query#createWeight.
## AnalyzingQueryParser removed (LUCENE-7355)
The functionality of AnalyzingQueryParser has been folded into the classic
QueryParser, which now passes terms through Analyzer#normalize when generating
queries.
## CommonQueryParserConfiguration.setLowerCaseExpandedTerms removed (LUCENE-7355)
This option has been removed as expanded terms are now normalized through
Analyzer#normalize.