开发者

Not Saving Domain Object with Grails Searchable Plugin

开发者 https://www.devze.com 2023-01-12 00:48 出处:网络
Is it possible to use the Searchable Plugin to create an index of objects and n开发者_如何学Pythonever actually save the objects to the database?I think so. If you never save the objects, then I think

Is it possible to use the Searchable Plugin to create an index of objects and n开发者_如何学Pythonever actually save the objects to the database?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号