6
votes

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?

1
where in your code are you reindexing? I suspect there is a .lock file somewhere that was created and is causing your problems. More code would help.Aaron Saunders
A code segment has been added. I am also looking at not using the default local file indexes, but storing the cache in the database with JDBCDirectory.user304217
Why are you calling reindex right after the object is saved? When the object is saved it should be indexed automatically.Maricel
In the config, the auto index has been switched off, since it did not work consistently, but calling it explicitly, did cause the indexing to take place.user304217
I suggest you take a look at ElasticSearch. It is developed by Compass developer, and it is the future for Compass. There is also a grails plugin for it. kimchy.org/the_future_of_compassfelipenasc

1 Answers

0
votes

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.