Close Match - PostProcess
I. ReIndex and Reload Dictionary
II. Save Dictionary
- Why
GSpell.update( ) saves new index in the memory. However, if the web server or applications crash. We will lose those indexes in the memory. GSpell.save( ) provides a API to save index from memory to dictionary file. Also, in LexBuild, we can also Reindex and reload the dictionary as described above to prevent losing index.
- When
Due to the design of daily automatic reindex and reload, there is no need to save dictionary from memory. However, LexBuiuld provides a feature for SA to manually save index from memory to file.
- What
- It takes more than 20 min. to save LexiconLb (850000 terms). Thus, LexBuild uses a separate thread to save to avoid slow web-performance
- call gSpell.save() to save indexes from memory to file
- Disable "Approve" button during save process by checking the value of gSpell.isBusy()
- Disable GSpell related interface features during save process by checking the value of gSpell_.isBusy():
- Approval -> Creation
- Approval -> Modification
- Post-Proc -> GSpell (ReIndex, Reload, Sava features)
- If the ${LEXICON_OUTPUTS}/InflVars.uSort or ${LEXICON_OUTPUTS}/InflVarsTemp.uSort is empty (0 line), the gSpell dictionary (gSpell Java Object) will never complete the save (always busy). In such case, the disable button will (always) showup after hitting Post-Proc -> GSpell -> Save button.
- Moreover, if the Apache Tomcat server is reboot when ${LEXICON_OUTPUTS}/InflVarsTemp.uSort is empty (0 line), the gSpell_ is null, thus, the call to gSpell_.isBusy() cause null exception.
- Thus, we fix the issue by checking if gSpell_ is null. If so, we assign gSpell_.isBusy() to false.