This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Searchable Plug in : how to boost the domains properties.

Praveen Kumar
Ranch Hand
Posts: 133
  • 0
  • 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 ...

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:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic