mirror of https://github.com/apache/lucene.git
LUCENE-1737: set up FieldInfos correctly the when we open a pre-4.0 index
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1050790 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b5726a4267
commit
89d6a37d48
|
@ -830,7 +830,7 @@ public class IndexWriter implements Closeable {
|
|||
private FieldInfos getCurrentFieldInfos() throws IOException {
|
||||
final FieldInfos fieldInfos;
|
||||
if (segmentInfos.size() > 0) {
|
||||
if (segmentInfos.getFormat() > DefaultSegmentInfosWriter.FORMAT_4_0) {
|
||||
if (segmentInfos.getFormat() > DefaultSegmentInfosWriter.FORMAT_HAS_VECTORS) {
|
||||
// Pre-4.0 index. In this case we sweep all
|
||||
// segments, merging their FieldInfos:
|
||||
fieldInfos = new FieldInfos();
|
||||
|
|
|
@ -35,13 +35,13 @@ public class DefaultSegmentInfosWriter extends SegmentInfosWriter {
|
|||
* diagnostics storage, and switches userData to Map */
|
||||
public static final int FORMAT_DIAGNOSTICS = -9;
|
||||
|
||||
/** Each segment records whether it has term vectors */
|
||||
public static final int FORMAT_HAS_VECTORS = -10;
|
||||
|
||||
/** Each segment records whether its postings are written
|
||||
* in the new flex format */
|
||||
public static final int FORMAT_4_0 = -11;
|
||||
|
||||
/** Each segment records whether it has term vectors */
|
||||
public static final int FORMAT_HAS_VECTORS = -10;
|
||||
|
||||
/** This must always point to the most recent file format.
|
||||
* whenever you add a new format, make it 1 smaller (negative version logic)! */
|
||||
public static final int FORMAT_CURRENT = FORMAT_4_0;
|
||||
|
|
Loading…
Reference in New Issue