aspose file tools*
The moose likes Groovy and the fly likes Doubt in searchable plug in.(Sort) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Doubt in searchable plug in.(Sort)" Watch "Doubt in searchable plug in.(Sort)" New topic
Author

Doubt in searchable plug in.(Sort)

Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133

I am working searchable plugin in grails app to have sophisticated search functionality in my app.

Though it is working exceptionally well, Here i have small doubt i have.

Suppose i have domain property as name and the values for the name in the DB is :

Praveen race
Praveen Kuma race
Praveen Kumar Race

When i searched as "Praveen race" the data is coming as

Praveen Kuma race ............................
Praveen Kumar Race ..............................
Praveen race ....................................

But the user expects Praveen race row is the first one as there is exact match with "Praveen race" right ?. I have not configured any sort functionality.

Please help me out.




sergio ramirez
Greenhorn

Joined: Aug 28, 2011
Posts: 4

Hi Praveen!

Grails searchable plugin uses Lucene's StandardAnalyzer so if you declared index properties as "analyzed" then are lowercased to normalize it, so.. it doesn't matter if you have:

Praveen Kuma race ............................
Praveen Kumar Race ..............................
Praveen race ....................................

they will always be indexed as:

praveenkumarace ............................
praveenkumarrace ..............................
praveenrace ....................................

and your search term will be normalized too.
If you don't want to normalize you could use "not_analyzed" and it's value will reamain verbatim in the index.
I recommend you to read http://grails.org/Searchable+Plugin+-+Analyzers if you want to know more about them.

Regards,
Serch
Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133
Thanks a lot. You helped me a lot :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in searchable plug in.(Sort)