• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in searchable plug in.(Sort)

 
Ranch Hand
Posts: 133
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.




 
Greenhorn
Posts: 4
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot. You helped me a lot :-)
 
reply
    Bookmark Topic Watch Topic
  • New Topic