[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-112) Unkown @FullTextFilter when attempting to associate a filter
Gerard Toonstra (JIRA)
noreply at atlassian.com
Sat Aug 25 16:51:57 EDT 2007
Unkown @FullTextFilter when attempting to associate a filter
-------------------------------------------------------------
Key: HSEARCH-112
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-112
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.0.0.beta4
Environment: Linux Ubuntu 7.04 / JDK 1.5.
Reporter: Gerard Toonstra
I am using Hibernate Search 3.0.0 Beta 4. This version for me offers functionality that I'd like to use, which is the "enableFullTextFilter" calls. I followed the instructions as per the example. I have multiple entities declared in my Hibernate space, but only one entity that has FullTextFilterDef settings. When searching on that entity using the Filter restriction, the "enableFullTextFilter" call results in a SearchException:
[WARN] StandardContext[]Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract net.sf.pdune.client.dto.IssueBriefDTO[] net.sf.pdune.client.services.IssueService.search(java.lang.String,int,int) throws net.sf.pdune.client.UIException' threw an unexpected exception: org.hibernate.search.SearchException: Unkown @FullTextFilter: project
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:268)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:366)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:222)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:174)
I think this is due to the fact that the SearchFactoryImpl class recreates the filterDefinitions map on each call of bindFilterDefs:
public class SearchFactoryImpl implements SearchFactoryImplementor {
...
private void bindFilterDefs(XClass mappedXClass) {
filterDefinitions = new HashMap<String, FilterDef>();
...
}
My code where I am declaring the filter:
@Entity
@Table(name="ISSUE")
@Indexed(index="issue")
@FullTextFilterDef(name = IssueProjectFilterFactory.FILTER_NAME, impl = IssueProjectFilterFactory.class)
@SequenceGenerator( name="ISSUE_SEQ", sequenceName="seq_issue")
public class Issue extends PersistentObject implements Comparable
and the query code:
org.apache.lucene.search.Query luceneQuery = MultiFieldQueryParser.parse( query, Issue.FIELDS, flags, analyzer );
FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery, Issue.class );
fullTextQuery.enableFullTextFilter( IssueProjectFilterFactory.FILTER_NAME ).setParameter(
IssueProjectFilterFactory.PARAM_NAME, projects );
This logically does not happen when there is only one class being mapped in Hibernate, globally, since the map would not be emptied of the others.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list