-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to avoid reindexing of an entity
PostPosted: Wed Jan 18, 2012 11:13 am 
Newbie

Joined: Sat Dec 10, 2011 5:57 pm
Posts: 11
Hello.
Is there a way how to avoid reindexing of an entity each time the entity is changed? Whenever I update an entity (which may be several times per second) the entity is reindexed. I would need something which allows me to control how often the entity is reindexed, let say once per two seconds only (if changed).

Any comments are welcome


Top
 Profile  
 
 Post subject: Re: How to avoid reindexing of an entity
PostPosted: Wed Jan 18, 2012 11:31 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

You could disable automatic indexing (hibernate.search.indexing_strategy = manual) and re-index manually based on a trigger event. Of course you need some sort of field in the database in this case which you can query to determine the changed entities (eg a last update timestamp). Is this what you are after?

Alternatively you could try to write your own FullTextIndexEventListener. It all depends really what you want to achieve. Is the automatic indexing really a bottleneck? How up to date does your index have to be?

--Hardy


Top
 Profile  
 
 Post subject: Re: How to avoid reindexing of an entity
PostPosted: Wed Jan 18, 2012 1:03 pm 
Newbie

Joined: Sat Dec 10, 2011 5:57 pm
Posts: 11
hardy.ferentschik wrote:
Hi,

You could disable automatic indexing (hibernate.search.indexing_strategy = manual) and re-index manually based on a trigger event. Of course you need some sort of field in the database in this case which you can query to determine the changed entities (eg a last update timestamp). Is this what you are after?


Thanks for your answer.
This option sounds quite interesting.

hardy.ferentschik wrote:
Alternatively you could try to write your own FullTextIndexEventListener. It all depends really what you want to achieve. Is the automatic indexing really a bottleneck? How up to date does your index have to be?

--Hardy


The index can be few second late. The automatic indexing in my application is like indexing a text paragraph after each new character typed.
I thought about my own FullTextIndexEventListener first, but your first suggestion sounds realy interesting.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.