permaculture playing cards*
The moose likes Groovy and the fly likes Searchable Plug in : how to boost the domains  properties. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Searchable Plug in : how to boost the domains  properties." Watch "Searchable Plug in : how to boost the domains  properties." New topic

Searchable Plug in : how to boost the domains properties.

Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133
Hi ,

I have two domain classes say Race and Registration and i am using Searchable plug in to search the values in Race and Registration. Race and Registration domain classes have one to Many relationship.

Race domain class :: properties are name, dateCreated, city and state and Registration domain( Who are participated in Race ) properties are :: UserName , city, state, email etc...

I am using search on Race domain like ...

I am getting the data as per searchable default functionality as per score( hit). But I want to display the result in different format say When i searched for value,

if the search value equals(presents) to in one Race instance, in another Race instance and Race.state in another Race instance and in another instance and Registration.state in another instance then I should get the result as

Race.Name Race Instance Instance
Registration.state instnace Race Instance
Race.state Race Instance

That means we should give first preference (boost) to Race.Name and then prefernce to associated properties like city and state in Registration and finally to other properties in Race domain . for that i have configured boost in Race and registration like this :

Race ::
static searchable = {
[except : ['id','version','distance','cost','maxRunners'] ]
spellCheck "include"
registrations component : true
boost name 4.0

Registration ::

static searchable = {
[except : ['id','version','dateCreated','paid','dateOfBirth'] ]
root false

boost city : 3.0
boost state : 3.0


But still i am getting and Race.state earlier than and state values in search result.

please help me on this.

I agree. Here's the link:
subject: Searchable Plug in : how to boost the domains properties.
Similar Threads
Hibernate 3.0 - Checking 0 named queris
Doubt in searchable plug in.(Sort)
Grails 1.1 Web Application Development
HibernateTools Generating Wrong Code
Launching Tomcat via Eclipse no longer working after Snow Leopard upgrade