Hi Sanne,
The Same project which you shared is working for me and i am able to run the ServiceTest and no exception occured while creating
Hibernate Search Factory. :)
On Running the Same i could see few errors though, not sure is there anything i need to modify in tweet.class.
Code:
FullTextQuery droolsQuery = service.messagesMentioning( "Drools" );
Assert.assertEquals( 2, droolsQuery.getResultSize() );
List list = droolsQuery.list();
droolsQuery.getResultSize() gives me result size as 2 but the List is Empty ([]). Also on List call i can see SQL Queries are fired in the log.
Hibernate: select this_.id as id1_0_0_, this_.message as message2_0_0_, this_.sender as sender3_0_0_, this_.timestamp as timestam4_0_0_ from Tweet this_ where (this_.id in (?, ?))
Since the List is returned as empty, it failed in line no 82
Code:
FullTextQuery infinispanQuery = service.messagesMentioning( "infinispan" );
Assert.assertEquals( 1, infinispanQuery.getResultSize() );
Tweet infinispanRelatedTweet = (Tweet) infinispanQuery.list().get( 0 );
PFB, is the Error Got.
Code:
java.lang.IndexOutOfBoundsException: Index: 0
at java.util.Collections$EmptyList.get(Unknown Source)
at org.hibernate.search.demos.tweets.ServiceTest.testHibernateSearchUsingHibernateNativeAPIs(ServiceTest.java:82)
Could you please assist me on this?
Many thanks for the Help.
Thank you,
Domnic Nadar.