mstein / elasticsearch-grails-plugin

ElasticSearch grails plugin
Based on Graeme Rocher initial stub. Note that it is still in early stage.
Other
62 stars 164 forks source link

Searchable closure to use for inheritance #39

Open cwneill opened 12 years ago

cwneill commented 12 years ago

Our domain model has simple inheritance with class B inheriting from concrete base class A. We would like all instances of plain A's and B's to show up in the Elasticsearch index and be able to retrieve both A's and B's with the same query. We can't figure out what to specify for the searchable closure in class B to make this work. Any suggestions or examples would be greatly appreciated.

Charlie

class A implements Comparable {

static searchable = { types component: true author component: true categories component: true state component: true ... imageSmallUrl index: 'not_analyzed', excludeFromAll: false screenshot2Url index: 'not_analyzed', excludeFromAll: false

except = [
    'createdBy',
    'createdDate',
    'editedBy',
    'version'
]

}

...

}

class B extends A {

static searchable = { ... <<<<<<<====== Not sure what to put here! }

String systemUri String externalId String externalViewUrl String externalEditUrl

...

}