Grails searchable plugin
Posted
by Don
on Stack Overflow
See other posts from Stack Overflow
or by Don
Published on 2009-11-30T18:08:16Z
Indexed on
2010/06/09
20:42 UTC
Read the original article
Hit count: 342
Hi,
In my Grails app, I'm using the Searchable plugin for searching/indexing. I want to write a Compass/Lucene query that involves multiple domain classes. Within that query when I want to refer to the id of a class, I can't simply use 'id' because all classes have an 'id' property. Currently, I work around this problem by adding the following property to a class Foo
public Long getFooId() {
return id
}
static transients = ['fooId']
Then when I want to refer to the id of Foo within a query I use 'fooId'. Is there a way I can provide an alias for a property in the searchable mapping rather than adding a property to the class?
© Stack Overflow or respective owner