Aaron Saunders
Aaron Saunders

Reputation: 33335

Not Saving Domain Object with Grails Searchable Plugin

Is it possible to use the Searchable Plugin to create an index of objects and never actually save the objects to the database?

Upvotes: 1

Views: 229

Answers (1)

Javid Jamae
Javid Jamae

Reputation: 8999

I think so. If you never save the objects, then I think you can just call:

domainInstance.index()

But I've never tried it, so I'm not sure if it just indexes the one instance, or any instance of that class.

See here: https://svn.codehaus.org/grails-plugins/grails-searchable/trunk/src/groovy/org/codehaus/groovy/grails/plugins/searchable/compass/domain/DynamicDomainMethodUtils.groovy

If you just want to save the object but just want to index manually, then set the following in your conf/Searchable.groovy config file:

mirrorChanges = false
bulkIndexOnStartup = false

See here: https://svn.codehaus.org/grails-plugins/grails-searchable/trunk/src/conf/Searchable.groovy

Upvotes: 1

Related Questions