• Post Reply Bookmark Topic Watch Topic
  • New Topic

Searchable Plug in : how to boost the domains properties.  RSS feed

Praveen Kumar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!