Thursday, October 16, 2008

Grails Searchable Plugin is Awesome

I am working on adding search to the Q2OH web site. Getting it to work took about 20 minutes. Getting it to work just like I wanted it to took a day. All thanks to the Searchable plugin by Maurice Nicholson. It does exactly what it says it does and it does it well. I did run into a slight setback getting the suggested queries to work correctly. It was a syntax issue and once I got the spellCheck option correctly included in the closure it performed as advertised.

static searchable = {
only = ['content', 'author']
content: spellCheck 'include'
}

Now when you search for "sea", if there are no results it will ask if you want to search for "see" instead.

3 comments:

  1. That's all the code you need to search a field? Inconceivable...

    ReplyDelete
  2. love grails
    love grails plugins
    love grails searchable plugin

    ReplyDelete
  3. Please can you tell me how to use searchable plugin with grails. I need it for my project

    ReplyDelete