Using the Grails Searchable plugin, I’ve got these classes:
class Person {
static searchable = {
address component: true
}
}
and:
class Address {
static searchable = {
root false
}
String country
}
I want to do a specific search for persons from a specific country. “country:NL” doesn’t work. “address:country:NL” doesn’t work either. I can’t find anything about the syntax for this. Any ideas?
I think I’ll have to do some clever indexing or some other trick in the searchable closure, but I just can’t find it.
I created a basic app (Grails 1.3.5, Searchable 0.5.5.1) with your two classes and searching for ‘country:NL’ works for me. Did you remember to call index() before trying to search?
Person:
Address:
Bootstrap:
Then I browsed to to /searchable and searched for country:NL and got person 1 returned.
If you want to see what Searchable is doing under the covers with regards to fields/indexes etc – Luke is a very handy tool (just download the executable JAR): http://code.google.com/p/luke/
The index files are in
cheers
Lee