-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Duplicate objects in search 3.3.0 and upper
PostPosted: Thu Oct 25, 2012 2:14 pm 
Beginner
Beginner

Joined: Mon Mar 01, 2010 12:24 pm
Posts: 22
Hello,

I get a strange behaviour after migrating Hibernate seach from 3.2.1 to 3.3.0: some queries return duplicate objects.
The only thing I did in order to use the version 3.3 is to delete listeners as below:

Code:
configuration.setProperty("hibernate.search.autoregister_listeners", "false");
      String fullTextIndexListener = FullTextIndexEventListener.class.getName();
      configuration.setListener("post-update", fullTextIndexListener);
      configuration.setListener("post-insert", fullTextIndexListener);
      configuration.setListener("post-delete", fullTextIndexListener);
      configuration.setListener("post-collection-recreate", fullTextIndexListener);
      configuration.setListener("post-collection-remove", fullTextIndexListener);
      configuration.setListener("post-collection-update", fullTextIndexListener);
      String[] listeners = new String[] {DefaultFlushEventListener.class.getName(), fullTextIndexListener};
      configuration.setListeners("flush", listeners);


I tried using the querybuilder to query my failing queries and I get exactly the same result : duplicate objects.
Is the behaviour of listeners different? What did I miss? Have you an idea?

Thanks in advance,


Top
 Profile  
 
 Post subject: Re: Duplicate objects in search 3.3.0 and upper
PostPosted: Fri Oct 26, 2012 5:22 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
in version 3.3 you don't need to register the listeners anymore. In theory it should prevent to register duplicates, but that protection might be failing you for some other reason.

Could you try to not register anything? It looks like it might be triggering indexing twice. Of course if your index already exists it might already contain duplicates, so try this on an empty index first. If it resolved your issue you can fix the existing index using the MassIndexer.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Duplicate objects in search 3.3.0 and upper
PostPosted: Fri Oct 26, 2012 2:53 pm 
Beginner
Beginner

Joined: Mon Mar 01, 2010 12:24 pm
Posts: 22
Thanks for you quick answer.

After searching why I get this behaviour, I discover that in my test suite sometimes, I created the table once (so first user indexing) then I dropped the table and I created again this table (second indexing). So right now, I correct this problem and indexes are working like a charm :)

Thanks for you advises :) but I do not understand why it worked with the previous version. Do you have an idea? (I am a bit curious about that)

Thanks,


Top
 Profile  
 
 Post subject: Re: Duplicate objects in search 3.3.0 and upper
PostPosted: Fri Oct 26, 2012 3:31 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Do you have an idea? (I am a bit curious about that)


No idea, and would like to know as well. We track all possible migration changes here, at least the ones we know of:
https://community.jboss.org/wiki/HibernateSearchMigrationGuide

Something which rings a bell?

Tests usually use a RAMDirectory so you throw away the index between tests, maybe you changed something in your tests or some of the changes affect your configuration from a ram index to a stored index.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.