简体   繁体   中英

Grails searchable plugin

My application is using the Grails searchable plugin, using Compass underneath.

The tables begin indexed is about 36 MB, and is building indexes of about 350 MB. This is small in most peoples books.

If we delete the indexes and start the Grails application, the index files are rebuild as expected, but then after about a day of running, we find this error. We are calling the 'reindex' on the TellMeEntity instances as they are saved to make sure the index is updated.

Exception org.compass.core.engine.SearchEngineException: Failed to delete alias [TellMeEntity] and ids [[stored/uncompressed,indexed,omitNorms,omitTf]]; nested exception is java.io.FileNotFoundException: /var/www/web17/log/mne/index/tellmeentity/segments_2 (No such file or directory) at org.compass.core.lucene.engine.transaction.readcommitted.ReadCommittedTransaction(doDelete:348)

Obviously once this error hits, the index are not updated, and the searches do not work on the newly entered data.

We have checked the simple things like disk space, etc. The 'segments_2' does not exist, but I would expect Compass to create it by itself.

In the grails-app/conf/Searchable.groovy file:

....

  mirrorChanges = true
  bulkIndexOnStartup = "fork"

....

In my code:

....

def formInstance = new TellMeEntity(name:'form',dataOwner:session.community,createBy:session.zoner,tellMeSite:form).save()
formInstance.reindex()

....

My current experience is that this code works well for about 24 hours, but then starts giving problems. We are generating about 3000 new entries per day, which does not sound like a high volume, so I don't think it is volume related.

How can this problem be fixed?

shoot from the hip: is your index location /var/www/web17/log/mne subject to some logfile rotation process that by error tries to rotate the index files? 24 hours looks like some cron-based job is interfering here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM