mirror of https://github.com/apache/lucene.git
remove dead code, take 2
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@981696 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
daeafbacf2
commit
022d7d2fe4
|
@ -186,12 +186,6 @@ final class FieldsReader implements Cloneable {
|
||||||
indexStream.seek(FORMAT_SIZE + (docID + docStoreOffset) * 8L);
|
indexStream.seek(FORMAT_SIZE + (docID + docStoreOffset) * 8L);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canReadRawDocs() {
|
|
||||||
// Since we currently only support >3.0 format anymore, always return true!
|
|
||||||
// I leave this method in because it may help for later format changes.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Document doc(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
|
final Document doc(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
|
||||||
seekIndex(n);
|
seekIndex(n);
|
||||||
long position = indexStream.readLong();
|
long position = indexStream.readLong();
|
||||||
|
|
|
@ -321,7 +321,7 @@ final class SegmentMerger {
|
||||||
FieldsReader matchingFieldsReader = null;
|
FieldsReader matchingFieldsReader = null;
|
||||||
if (matchingSegmentReader != null) {
|
if (matchingSegmentReader != null) {
|
||||||
final FieldsReader fieldsReader = matchingSegmentReader.getFieldsReader();
|
final FieldsReader fieldsReader = matchingSegmentReader.getFieldsReader();
|
||||||
if (fieldsReader != null && fieldsReader.canReadRawDocs()) {
|
if (fieldsReader != null) {
|
||||||
matchingFieldsReader = fieldsReader;
|
matchingFieldsReader = fieldsReader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,8 +104,12 @@ class TermVectorsReader implements Cloneable {
|
||||||
// docs
|
// docs
|
||||||
assert numTotalDocs >= size + docStoreOffset: "numTotalDocs=" + numTotalDocs + " size=" + size + " docStoreOffset=" + docStoreOffset;
|
assert numTotalDocs >= size + docStoreOffset: "numTotalDocs=" + numTotalDocs + " size=" + size + " docStoreOffset=" + docStoreOffset;
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
|
// TODO: understand why FieldInfos.hasVectors() can
|
||||||
|
// return true yet the term vectors files don't
|
||||||
|
// exist...
|
||||||
format = 0;
|
format = 0;
|
||||||
|
}
|
||||||
|
|
||||||
this.fieldInfos = fieldInfos;
|
this.fieldInfos = fieldInfos;
|
||||||
success = true;
|
success = true;
|
||||||
|
@ -136,7 +140,9 @@ class TermVectorsReader implements Cloneable {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canReadRawDocs() {
|
boolean canReadRawDocs() {
|
||||||
return format >= FORMAT_UTF8_LENGTH_IN_BYTES;
|
// we can always read raw docs, unless the term vectors
|
||||||
|
// didn't exist
|
||||||
|
return format != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Retrieve the length (in bytes) of the tvd and tvf
|
/** Retrieve the length (in bytes) of the tvd and tvf
|
||||||
|
@ -153,11 +159,6 @@ class TermVectorsReader implements Cloneable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SegmentMerger calls canReadRawDocs() first and should
|
|
||||||
// not call us if that returns false.
|
|
||||||
if (format < FORMAT_UTF8_LENGTH_IN_BYTES)
|
|
||||||
throw new IllegalStateException("cannot read raw docs with older term vector formats");
|
|
||||||
|
|
||||||
seekTvx(startDocID);
|
seekTvx(startDocID);
|
||||||
|
|
||||||
long tvdPosition = tvx.readLong();
|
long tvdPosition = tvx.readLong();
|
||||||
|
|
Loading…
Reference in New Issue