package Ġorg . got son . kom ga . interfaces . scheduler Ċ Ċ import Ġmu . Kotlin Logging Ċ import Ġorg . got son . kom ga . application . tasks . HIG HE ST _ PRIORITY Ċ import Ġorg . got son . kom ga . application . tasks . Task Receiver Ċ import Ġorg . got son . kom ga . infrastructure . search . Luc ene Entity Ċ import Ġorg . got son . kom ga . infrastructure . search . Luc ene Helper Ċ import Ġorg . springframework . boot . context . event . Application Ready Event Ċ import Ġorg . springframework . context . annotation . Profile Ċ import Ġorg . springframework . context . event . EventListener Ċ import Ġorg . springframework . stereotype . Component Ċ Ċ private Ġval Ġlogger Ġ= ĠKotlin Logging . logger Ġ{} Ċ Ċ @ Profile (" ! test ") Ċ @ Component Ċ class ĠSearch Index Controller ( ĊĠ Ġprivate Ġval Ġl uc ene Helper : ĠLuc ene Helper , ĊĠ Ġprivate Ġval Ġtask Receiver : ĠTask Receiver , Ċ ) Ġ{ ĊĊĠ Ġ@ EventListener ( Application Ready Event :: class ) ĊĠ Ġfun Ġcreate Index If None Exist () Ġ{ ĊĠĠĠ Ġif Ġ(! lucene Helper . index Exists ()) Ġ{ ĊĠĠĠĠĠ Ġlogger . info Ġ{ Ġ" Luc ene Ġindex Ġnot Ġfound , Ġtrigger Ġrebuild " Ġ} ĊĠĠĠĠĠ Ġtask Receiver . rebuild Index ( HIG HE ST _ PRIORITY ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġlogger . info Ġ{ Ġ" Luc ene Ġindex Ġversion : Ġ${ lucene Helper . getIndex Version () }" Ġ} ĊĠĠĠĠĠ Ġwhen Ġ( lucene Helper . getIndex Version ()) Ġ{ ĊĠĠĠĠĠĠĠĠ 1 , Ġ 2 Ġ-> Ġtask Receiver . rebuild Index ( HIG HE ST _ PRIORITY ) ĊĠĠĠĠĠĠĠĠ 3 Ġ-> Ġtask Receiver . rebuild Index ( HIG HE ST _ PRIORITY , Ġset Of ( Luc ene Entity . Series )) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ