mirror of https://github.com/apache/lucene.git
LUCENE-4086: remove 3.x cruft
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1348907 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cda03034d0
commit
b7a1c626dc
|
@ -345,11 +345,7 @@ final class SegmentMerger {
|
||||||
private void mergePerDoc(SegmentWriteState segmentWriteState) throws IOException {
|
private void mergePerDoc(SegmentWriteState segmentWriteState) throws IOException {
|
||||||
final PerDocConsumer docsConsumer = codec.docValuesFormat()
|
final PerDocConsumer docsConsumer = codec.docValuesFormat()
|
||||||
.docsConsumer(new PerDocWriteState(segmentWriteState));
|
.docsConsumer(new PerDocWriteState(segmentWriteState));
|
||||||
// TODO: remove this check when 3.x indexes are no longer supported
|
assert docsConsumer != null;
|
||||||
// (3.x indexes don't have docvalues)
|
|
||||||
if (docsConsumer == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
docsConsumer.merge(mergeState);
|
docsConsumer.merge(mergeState);
|
||||||
|
@ -366,11 +362,7 @@ final class SegmentMerger {
|
||||||
private void mergeNorms(SegmentWriteState segmentWriteState) throws IOException {
|
private void mergeNorms(SegmentWriteState segmentWriteState) throws IOException {
|
||||||
final PerDocConsumer docsConsumer = codec.normsFormat()
|
final PerDocConsumer docsConsumer = codec.normsFormat()
|
||||||
.docsConsumer(new PerDocWriteState(segmentWriteState));
|
.docsConsumer(new PerDocWriteState(segmentWriteState));
|
||||||
// TODO: remove this check when 3.x indexes are no longer supported
|
assert docsConsumer != null;
|
||||||
// (3.x indexes don't have docvalues)
|
|
||||||
if (docsConsumer == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
docsConsumer.merge(mergeState);
|
docsConsumer.merge(mergeState);
|
||||||
|
|
|
@ -73,8 +73,8 @@ public class BM25Similarity extends Similarity {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The default implementation computes the average as <code>sumTotalTermFreq / maxDoc</code>,
|
/** The default implementation computes the average as <code>sumTotalTermFreq / maxDoc</code>,
|
||||||
* or returns <code>1</code> if the index does not store sumTotalTermFreq (Lucene 3.x indexes
|
* or returns <code>1</code> if the index does not store sumTotalTermFreq:
|
||||||
* or any field that omits frequency information). */
|
* any field that omits frequency information). */
|
||||||
protected float avgFieldLength(CollectionStatistics collectionStats) {
|
protected float avgFieldLength(CollectionStatistics collectionStats) {
|
||||||
final long sumTotalTermFreq = collectionStats.sumTotalTermFreq();
|
final long sumTotalTermFreq = collectionStats.sumTotalTermFreq();
|
||||||
if (sumTotalTermFreq <= 0) {
|
if (sumTotalTermFreq <= 0) {
|
||||||
|
|
Loading…
Reference in New Issue