Problema com o grails searchable
25/08/2009 00:00
0
Olá pessoal,

Estou com um problema com o grails searchable. É o seguinte:

Quando faço uma busca no mesmo para a qual não há resultados aparece a seguinte mensagem:

Nothing matched your query - dsgsdfdfh

Suggestions:
Try a suggested query: Search again with the suggestQuery option
Note: Suggestions are only available when classes are mapped with spellCheck options, either at the class or property level.
The simplest way to do this is add spellCheck "include" to the domain class searchable mapping closure.
See the plugin/Compass documentation Mapping sections for details.


E no text que está em azul(que na verdade é um link) quando clico, aparece a seguinte exceção:

Grails Runtime Exception
Error Details
Error 200: java.lang.IllegalStateException: Suggestions are only available when classes are mapped with "spellCheck" options, either at the class or property level. The simplest way to do this is add spellCheck "include" to the domain class searchable mapping closure. See the plugin/Compass documentation Mapping sections for details.
Servlet: grails
URI: /Library-webeffort/grails/searchable/index.dispatch
Exception Message: Suggestions are only available when classes are mapped with "spellCheck" options, either at the class or property level. The simplest way to do this is add spellCheck "include" to the domain class searchable mapping closure. See the plugin/Compass documentation Mapping sections for details.
Caused by: java.lang.IllegalStateException: Suggestions are only available when classes are mapped with "spellCheck" options, either at the class or property level. The simplest way to do this is add spellCheck "include" to the domain class searchable mapping closure. See the plugin/Compass documentation Mapping sections for details.
Class: SearchableService
At Line: [36]
Code Snippet:
Stack Trace
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.IllegalStateException: Suggestions are only available when classes are mapped with "spellCheck" options, either at the class or property level. The simplest way to do this is add spellCheck "include" to the domain class searchable mapping closure. See the plugin/Compass documentation Mapping sections for details.
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756)
at groovy.lang.Closure.call(Closure.java:292)
at groovy.lang.Closure.call(Closure.java:287)
at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:507)
at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:398)
at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:233)
at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:154)
at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:261)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:285)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:207)
at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:196)
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:129)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.parsePage(GrailsPageFilter.java:122)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:85)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:101)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:65)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.IllegalStateException: Suggestions are only available when classes are mapped with "spellCheck" options, either at the class or property level. The simplest way to do this is add spellCheck "include" to the domain class searchable mapping closure. See the plugin/Compass documentation Mapping sections for details.
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:130)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:112)
at SearchableService.search(SearchableService.groovy:36)
at SearchableService$$FastClassByCGLIB$$74543133.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java&#58;149)
at SearchableService$$EnhancerByCGLIB$$26dad09.search(<generated>)
at SearchableController$_closure1.doCall(SearchableController.groovy&#58;35)
at SearchableController$_closure1.doCall(SearchableController.groovy)


É muito estranho acontecer isso e já faz muito tempo que tento resolver e não consigo. Já pesquisei muito, tentei até procurar o trecho de código do plugin que faz essa parte para eliminar e o usuário não ter a opção de clicar para não aparecer a exceção, mas não consegui achar.

Assim sendo espero a ajuda de vocês. Agradeço muito desde já.

Ps.: Vai abaixo a figura da tela que dá erro. O link está circulado em vermelho.

Tags: Ferramentas/Plugins


0
Suggestions are only available when classes are mapped with &quot;spellCheck&quot; options, either at the class or property level. The simplest way to do this is add spellCheck &quot;include&quot; to the domain class searchable mapping closure. See the plugin/Compass documentation Mapping sections for details.


Nessa frase você tem exatamente a explicação do erro, a maneira de resolver e como obter mais detalhes <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->

Erro:
Suggestions are only available when classes are mapped with &quot;spellCheck&quot; options, either at the class or property level.


Como resolver:
The simplest way to do this is add spellCheck &quot;include&quot; to the domain class searchable mapping closure.


Mais detalhes:
See the plugin/Compass documentation Mapping sections for details.
23/11/2009 00:00



Ainda não faz parte da comunidade???

Para se registrar, clique aqui.


Aprenda Groovy e Grails com a Formação itexto!

Newsletter Semana Groovy

Assinar

Envie seu link!


Livro de Grails


/dev/All

Os melhores blogs de TI (e em português) em um único lugar!

 
Creative Commons
RSS Grails Brasil é mantido por itexto Consultoria.
Em caso de problemas contacte Henrique Lobo Weissmann (Kico) por e-mail: kico@itexto.com.br
Todo o conteúdo presente neste site adota o Creative Commons como licença padrão.
Ver: 4.14.0
itexto