70aaf7eaa7
Use this version starting at the existing schema version 15 (which has been in master for only a week or so). Notable changes: - Can use the new IndexWriter#setCommitOnClose(boolean) method to simplify closing an index. - This means we no longer need to pass Version into the IndexWriterConstructor. According to [1], this was _only_ used to determine whether or not the index should be committed on close, as this behavior differed between versions. No more mapping schema versions to Lucene versions! - IndexWriters are now forced to use their configured Analyzer, removing the methods taking an Analyzer (which we weren't using anyway). This saves some code in AutoCommitWriter. - Lucene 5 cannot read indexes created by older versions without an additional jar in the classpath, so we need to add that. The most annoying change is that sorting cannot be done on normal numeric fields by default anymore[2]. This was inefficient anyway, as Lucene had to seek and read all index field values before doing the sorting. Switch to the newer DocValues API for strongly-typed sortable fields. This introduces some medium-term ugliness as the sort spec changes depending on the schema version. Unfortunately we can only use DocValues on new index versions; older versions need to use the new UninvertingReader API, which provides FieldCache based sorting without a reindex. An overzealous check in a static method in Lucene[3] means we need to temporarily fork SearcherManager.java from Lucene in order to get this to work with the NRT machinery. Since we have to jump through significant hoops to get older index versions readable by this version of Lucene, add a test specifically for schema v14. [1] https://issues.apache.org/jira/browse/LUCENE-5871 [2] https://issues.apache.org/jira/browse/LUCENE-5666 [3] https://issues.apache.org/jira/browse/LUCENE-6370 Change-Id: I843be2fb697779fc741e25459a2716280b2bd0b6
43 lines
997 B
Python
43 lines
997 B
Python
QUERY_BUILDER = [
|
|
'src/main/java/com/google/gerrit/lucene/QueryBuilder.java',
|
|
]
|
|
|
|
java_library(
|
|
name = 'query_builder',
|
|
srcs = QUERY_BUILDER,
|
|
deps = [
|
|
'//gerrit-antlr:query_exception',
|
|
'//gerrit-reviewdb:server',
|
|
'//gerrit-server:server',
|
|
'//lib:gwtorm',
|
|
'//lib:guava',
|
|
'//lib/lucene:core',
|
|
],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_library(
|
|
name = 'lucene',
|
|
srcs = glob(['src/main/java/**/*.java'], excludes = QUERY_BUILDER),
|
|
deps = [
|
|
':query_builder',
|
|
'//gerrit-antlr:query_exception',
|
|
'//gerrit-common:annotations',
|
|
'//gerrit-common:server',
|
|
'//gerrit-extension-api:api',
|
|
'//gerrit-reviewdb:server',
|
|
'//gerrit-server:server',
|
|
'//lib:guava',
|
|
'//lib:gwtorm',
|
|
'//lib/guice:guice',
|
|
'//lib/guice:guice-assistedinject',
|
|
'//lib/jgit:jgit',
|
|
'//lib/log:api',
|
|
'//lib/lucene:analyzers-common',
|
|
'//lib/lucene:backward-codecs',
|
|
'//lib/lucene:core',
|
|
'//lib/lucene:misc',
|
|
],
|
|
visibility = ['PUBLIC'],
|
|
)
|