fix: upgrade lucene version

will trigger a full rebuild of the index
This commit is contained in:
Gauthier Roebroeck 2021-12-22 16:45:48 +08:00
parent ec0acbc5cc
commit 4ee30dde96
4 changed files with 5 additions and 5 deletions

View file

@ -61,7 +61,7 @@ dependencies {
implementation("commons-validator:commons-validator:1.7")
run {
val luceneVersion = "8.9.0"
val luceneVersion = "8.11.1" // 9.0.0 requires Java 11
implementation("org.apache.lucene:lucene-core:$luceneVersion")
implementation("org.apache.lucene:lucene-analyzers-common:$luceneVersion")
implementation("org.apache.lucene:lucene-queryparser:$luceneVersion")

View file

@ -18,12 +18,12 @@ class LuceneConfiguration(
@Bean
fun indexAnalyzer() =
with(komgaProperties.lucene.indexAnalyzer) {
MultiLingualNGramAnalyzer(minGram, maxGram, preserveOriginal).apply { version = Version.LUCENE_8_9_0 }
MultiLingualNGramAnalyzer(minGram, maxGram, preserveOriginal).apply { version = Version.LUCENE_8_11_1 }
}
@Bean
fun searchAnalyzer() =
MultiLingualAnalyzer().apply { version = Version.LUCENE_8_9_0 }
MultiLingualAnalyzer().apply { version = Version.LUCENE_8_11_1 }
@Bean
@Profile("test")

View file

@ -26,7 +26,7 @@ import kotlin.math.ceil
import kotlin.time.measureTime
private val logger = KotlinLogging.logger {}
private const val INDEX_VERSION = 2
private const val INDEX_VERSION = 3
@Component
class SearchIndexLifecycle(

View file

@ -26,7 +26,7 @@ class SearchIndexController(
} else {
logger.info { "Lucene index version: ${luceneHelper.getIndexVersion()}" }
when (luceneHelper.getIndexVersion()) {
1 -> taskReceiver.rebuildIndex(HIGHEST_PRIORITY)
1, 2 -> taskReceiver.rebuildIndex(HIGHEST_PRIORITY)
}
}
}