With the following search test:
{code} QueryBuilder qb = fullTextEntityManager.getSearchFactory().buildQueryBuilder().forEntity( ProductArticle.class ).get(); System.out.println(" passing 2 ...."); org.apache.lucene.search.Query query = qb .bool() .must(qb.keyword().onFields("header").matching("hibernate").createQuery()) .createQuery(); {code} its search result returns duplicate records. Please refer to the result as shown below:
{noformat} java.lang.AssertionError: [query result] expected size:<1> but was:<23> for <[[1, hibernate query, 2013-03-24 11:05:30.0], [1, hibernate query, 2013-03-24 11:05:30.0], [1, hibernate query, 2013-03-24 11:05:30.0], [1, hibernate query, 2013-03-24 11:05:30.0], [1, hibernate query, 2013-03-24 11:05:30.0], [1, hibernate query, 2013-03-24 11:05:30.0], [1, hibernate query, 2013-03-24 11:05:30.0], [1, hibernate query, 2013-03-24 11:05:30.0], [1, hibernate query, 2013-03-24 11:05:30.0], [3, the only tool, 2013-03-15 11:05:30.0], [3, the only tool, 2013-03-15 11:05:30.0], [3, the only tool, 2013-03-15 11:05:30.0], [3, the only tool, 2013-03-15 11:05:30.0], [3, the only tool, 2013-03-15 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0], [2, hibernate lucen, 2013-03-14 11:05:30.0]]> {noformat} I have also attached a sample project for the test case as reference.
|
|