Grails searchable is very slow is fixed

Grails searchable which bases on compass.
I have use it in my grails project, for item search.

It run very fast when records size is small ( < 20)
But when the records size is large than 1000, and the result set is > 100,
it become very very very …. sssslow. ( > 10 sec, before the screen is output).

I have turn on the debug log, and log show me that the search is finish very fast (< 0.1 sec).
Then I try to stop the grails (by Ctrl-C) when the search is working, and there are a stacetrace which has a keyword 'Unmarshall'.

I try to study about it, and find that Compass has a feature of 'supportUnmarshall', which will build the object form Compass Index information, someone said that it is slow and use memory, than I try to turn off it use the 'supportUnmarshall false', or fully block like this

static searchable = {
alias “SetTopBox”
supportUnmarshall false
location component : true
stbModel component : true
}

After it, grails cannot start up, then I try to set the “supportUnmarshall false” to all searchable object, then every thing happy.

One more you may need to know, after disable the supportUnmarshall, you need to enable the reload of the defaultMethodOptions in Searchable.groovy, or fully of the options like this,

defaultMethodOptions = [
search: [reload: true, escape: false, offset: 0, max: 10, defaultOperator: "and", suggestQuery:false],
suggestQuery: false
]

48 comments to Grails searchable is very slow is fixed

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>