Bug 831569 - blog example search error searching for a stoplist word
blog example search error searching for a stoplist word
Status: CLOSED DEFERRED
Product: JBoss Enterprise WFK Platform 2
Classification: JBoss
Component: Examples, Seam, HibernateSearch (Show other bugs)
2.0.0.ER8
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Karel Piwko
Karel Piwko
Seam2.3
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-13 06:33 EDT by Marek Schmidt
Modified: 2012-06-19 04:18 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-19 04:18:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marek Schmidt 2012-06-13 06:33:13 EDT
Description of problem:

Searching for a non-empty string that contains only stoplist words (e.g. "a") leads to an error:

org.hibernate.search.SearchException: Try to search with an empty string: title:ngrams
	org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.createQuery(ConnectedMultiFieldsTermQueryBuilder.java:106)
	org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.createQuery(ConnectedMultiFieldsTermQueryBuilder.java:81)
	actions.SearchService.getFullTextQuery(SearchService.java:63)
	actions.SearchService.getSearchResults(SearchService.java:39)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
	org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
	org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
	org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
	org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
	org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
	org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
	org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
	org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
	actions.SearchService_$$_javassist_seam_4.getSearchResults(SearchService_$$_javassist_seam_4.java)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
	org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
	org.jboss.seam.Component.callComponentMethod(Component.java:2269)
	org.jboss.seam.Component.getInstanceFromFactory(Component.java:2095)
	org.jboss.seam.Component.getInstance(Component.java:2008)
	org.jboss.seam.Component.getInstance(Component.java:1980)
	org.jboss.seam.Component.getInstance(Component.java:1974)
	org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
	org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
	org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
	org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
	com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
	com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
	org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
	org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
	com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
	javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
	javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
	javax.faces.component.UIData.getValue(UIData.java:731)
	javax.faces.component.UIData.getDataModel(UIData.java:1798)
	javax.faces.component.UIData.setRowIndexWithoutRowStatePreserved(UIData.java:484)
	javax.faces.component.UIData.setRowIndex(UIData.java:473)
	com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:81)
	javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
	javax.faces.component.UIData.encodeBegin(UIData.java:1118)
	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1777)
	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
	com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
	com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
	org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:88)
	javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
	com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
	org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98)
	org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
Comment 1 Marek Novotny 2012-06-13 07:34:45 EDT
That probably needs some help from HSearch devs, Sanne, could you help what is required to eliminate that exception with stoplist words?
Comment 2 Sanne Grinovero 2012-06-13 08:02:59 EDT
The business logic could validatethe search input is containing something which is not empty after analysis and show a message to the user about how correct input should be.

For a helper to see the tokenized input see:
org.hibernate.search.util.AnalyzerUtils.tokenizedTermValues(Analyzer, String, String)

Otherwise, we might think of changing the API a little bit to make this simpler; we could throw a subtype of SearchException instead, to make it easier to catch this problem specifically rather than asking business logic to pre-check.
Comment 3 Sanne Grinovero 2012-06-13 09:16:18 EDT
As a future usability improvement: https://hibernate.onjira.com/browse/HSEARCH-1161

Note You need to log in before you can comment on or make changes to this bug.