Open abowsher opened 8 years ago
I hope this helps...
Customize the name of the searchable
property:
http://noamt.github.io/elasticsearch-grails-plugin/guide/single.html#configuration
- elasticSearch.searchableProperty.name
The name of the ElasticSearch mapping configuration property that annotates domain classes. The default is 'searchable'.
Declare your classes o be searchable or not: http://noamt.github.io/elasticsearch-grails-plugin/guide/single.html#quickStart
Default mapping To declare a domain class to be searchable, the simplest way is to define the following static property in the code:
static searchable = true
Thanks for the reply... unfortunately that is not an easy solution either, because the content classes in the Weceem plugin use the searchable closure.
Also, I cannot put static searchable = false in my domain class, because it already has a searchable property. Even if it worked, this would force me to go through all of our classes and add this. That doesn't seem like the best solution.
Thankfully SearchableClassMappingConfigurator is a Spring bean, maybe I can override it with my own bean that excludes the right classes, for now.
My workaround almost worked (a custom Spring bean to take the place of the SearchableClassMappingConfigurator and simply only look for 'searchable' in the packages I care about)... it worked locally. But when deploying as a war to a Linux box, I get some weird exception 'MasterNotDiscoveredException'. I have no idea what that means or how to work around it, for me this plugin is buried in Weceem. I am resolved to changing my classes to not have a property named 'searchable', and see if this fixes the problem. If anyone could tell me what this exception means and how to work around it (set some environment variable? fix permissions on a directory somewhere b/c maybe it can't build the index for that reason?), that would be cool.
Fwiw, there were some grails options that needed to be set that I wasn't familiar with. I guess I expected Weceem to just work out of the box (well, I expected it needed configuration but not the plugins underneath it). The saving grace was this post:
The answer there really came from this:
https://github.com/jCatalog/weceem-app/blob/master/grails-app/conf/Config.groovy#L172
(look down lower in the file, you'll see these settings):
elasticSearch.datastoreImpl = 'hibernateDatastore'
elasticSearch.bulkIndexOnStartup = true
elasticSearch.disableAutoIndex = false
elasticSearch.client.mode = 'local'
elasticSearch.index.store.type = 'memory' // store local node
Sorry for the verbosity, but I thought it might help someone else.
I am upgrading the Weceem plugin. It switched to using ElasticSearch. Now, one of my domain classes outside of Weceem is causing an exception at startup, because it had a property named 'searchable' and ElasticSearch thinks it's the searchable closure.
I do have a few classes I've extended from Weceem for custom content types. I have no interest in making any of my other application domain classes searchable (outside of the classes in Weceem and my extensions to it). It would be great if I could tell the plugin what domain classes/packages to include/exclude.