File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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
Author

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 ... Race.search(....)

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 Race.name in one Race instance, Race.city in another Race instance and Race.state in another Race instance and Registration.city in another instance and Registration.state in another instance then I should get the result as


Race.Name Race Instance
Registration.city Instance
Registration.state instnace
Race.city 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 Race.city and Race.state earlier than Registration.city and state values in search result.


please help me on this.








 
jQuery in Action, 2nd edition
 
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