[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-396) disableFullTextFilter(String name) in FullTextQueryImpl does not disable the filter.
wolfjourn (JIRA)
noreply at atlassian.com
Wed Aug 26 11:44:15 EDT 2009
disableFullTextFilter(String name) in FullTextQueryImpl does not disable the filter.
------------------------------------------------------------------------------------
Key: HSEARCH-396
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-396
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.1.1.GA
Environment: Hibernate 3.3.2.GA
Hibernate Annotations 3.4.0.GA
RDBMS: MySQL, version: 5.0.70-log
JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6
Reporter: wolfjourn
The disableFullTextFilter(String name) method in FullTextQueryImpl does not cause the filter to be disabled. This is due to incorrect logic in the buildFilters() method in the same class.
For example,
fullTextQuery = s.createFullTextQuery( query, Driver.class );
fullTextQuery.list().size(); /* Returns 10 */
fullTextQuery.enableFullTextFilter("security");
fullTextQuery.list().size(); /* Returns 5 */
fullTextQuery.disableFullTextFilter("security");
fullTextQuery.list().size(); /* Returns 5. Should return 10. */
Initially, buildFilters() constructs `filter' using the "security" filter from filterDefinitions. During the disableFullTextFilter("security") call, the filter is removed from `filterDefinitions'. However, `filter' remains intact. The subsequent call to buildFilters() returns immediately as `filterDefinitions' is now empty, leaving `filter' intact and thus not disabling the "security" filter. Furthermore, if a filter is disabled and replaced with another filter, the result will be a composition of both filters as towards the bottom of buildFilters(), any existing `filter' is chained onto the end of a new `chainedFilter'. This results in an empty result set if the sets returned by the filters are mutually exclusive.
It looks like this issue was resolved with revision 16755. However, this is still worth documenting here for other 3.1.1.GA users that might run into the same issue.
--
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