Switch to Lucene 4.6 in code
This change introduces new index schema version. Change-Id: Ib05e2769692eb61e9adc2d7053140cad42ee5781
This commit is contained in:
committed by
Dave Borowitz
parent
20d672e49f
commit
71f734b5c1
@@ -118,12 +118,16 @@ public class LuceneChangeIndex implements ChangeIndex {
|
||||
ImmutableMap.builder();
|
||||
@SuppressWarnings("deprecation")
|
||||
Version lucene43 = Version.LUCENE_43;
|
||||
@SuppressWarnings("deprecation")
|
||||
Version lucene44 = Version.LUCENE_44;
|
||||
for (Map.Entry<Integer, Schema<ChangeData>> e
|
||||
: ChangeSchemas.ALL.entrySet()) {
|
||||
if (e.getKey() <= 3) {
|
||||
versions.put(e.getValue(), lucene43);
|
||||
} else if (e.getKey() <= 5) {
|
||||
versions.put(e.getValue(), lucene44);
|
||||
} else {
|
||||
versions.put(e.getValue(), Version.LUCENE_44);
|
||||
versions.put(e.getValue(), Version.LUCENE_46);
|
||||
}
|
||||
}
|
||||
LUCENE_VERSIONS = versions.build();
|
||||
|
||||
@@ -45,7 +45,7 @@ public class QueryDocumentationExecutor {
|
||||
LoggerFactory.getLogger(QueryDocumentationExecutor.class);
|
||||
|
||||
private static final String INDEX_PATH = "index.zip";
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_44;
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_46;
|
||||
|
||||
private IndexSearcher searcher;
|
||||
private QueryParser parser;
|
||||
|
||||
@@ -118,6 +118,9 @@ public class ChangeSchemas {
|
||||
ChangeField.APPROVAL,
|
||||
ChangeField.MERGEABLE);
|
||||
|
||||
// For upgrade to Lucene 4.6.0 index format only.
|
||||
static final Schema<ChangeData> V6 = release(V5.getFields().values());
|
||||
|
||||
private static Schema<ChangeData> release(Collection<FieldDef<ChangeData, ?>> fields) {
|
||||
return new Schema<ChangeData>(true, fields);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ import java.util.List;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
public class DocIndexer {
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_44;
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_46;
|
||||
|
||||
@Option(name = "-z", usage = "output zip file")
|
||||
private String zipFile;
|
||||
|
||||
Reference in New Issue
Block a user