we're creating grails plugin which should allow users to pick their own search plugin support and we want to provide integration with your plugin out of the box. we would like to declare the mappings in our domain classes but we don't want to use static searchable = ... property for this purpose, because other search plugins uses the same name. would be great if we can change the default property name to something like static elasticGormSearchable = ... so it won't conflict anymore and we can provide mapping for the old searchable plugin as well.
static searchable = ...
static elasticGormSearchable = ...
if making the property name configurable is way to much work would be nice if you provide few fallback aliases for that property out of box if the searchable property is not found on the domain class.
Sounds interesting! Is there a github project?
Making the searchable property configurable shouldn't be too much bother, though I'd prefer that it's default value will remain searchable for backwards compatibility.
Yeah, it's https://github.com/MetadataRegistry/ModelCataloguePlugin/ (most recent work is in develop branch). My colleague will commit the elastic search plugin for it today. We had to use an ugly hack in plugin descriptor to reassign the static property values and it works but having the default fallback property will be much clearer solution.
Sure keeping searchable as default property name sounds good to me.
Actually, the alias property should have the priority. We're probably going to have searchable and elasticGormSearchable properties in the domain classes and it makes no difference if you prefer searchable in favor of the new alias
#17 Configurable mapping property name:
* Property is made configurable by using the configuration key 'elasticSearch.searchableProperty.name'. Defaults to 'searchable'
Will be included in the next release.
Can be customized using the 'elasticSearch.searchableProperty.name' configuration.