|
|
Hi all,
I have a simple question:
Given relation Tekst that hasMany Tekstsprog, I want to be able to search both Tekst and TekstSprog, using component and root, so only Tekst objects are returned.
The code:
Tekst:
class Tekst {
static hasMany = [sprogTekster: TekstSprog]
static searchable = {
sprogTekster component: true
}
}
Tekstsprog:
class TekstSprog {
static searchable = {
root false
}
String tekstIndhold
static belongsTo = [ tekst : Tekst, sprog : Sprog ]
static constraints = {
tekstIndhold( blank : false, size : 1..1024 )
}
}
This doesn't return any results when searching on something located in the "TekstSprog" object. Am I doing something wrong? If I remove
root false
I get matching results, however the returned objects are of TekstSprog and not Tekst.
I found lots of places saying this is possible - and indeed it also works for me, with a 1-1 relation. Can't this be done in a 1-* relation??
I really hope that some can clarify this for me!
(Sorry for repost, got accepted to mailing list now...)
|