-->
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: Conditional Indexing Possible?
PostPosted: Tue Jan 11, 2011 3:39 pm 
Newbie

Joined: Fri Sep 29, 2006 12:00 pm
Posts: 2
I am still trying to find an answer to a very simple question:

Is it possible to conditionally index an entity? If I have millions of rows in a database and I only want to have a subset appear in an index, how is this possible? The simplest case is that I have dates on entities and I only want entities within a specific date range to be located within an index. I don't mean 'queried'. They can't be in the index because the indexing will take far to long, and too large when a system has been brought down, or initially started.

I would like to keep a subset of data, so I can use a RAMDirectory too. Hopefully this all works well with EHCache since I have distributed cache.

Does this make much sense?

It seems there is something vital missing, like a simple 'index query' that could be provided to the indexer for the specific entity. Perhaps there is such a mechanism?

Thanks for your time,

Briggs.


Top
 Profile  
 
 Post subject: Re: Conditional Indexing Possible?
PostPosted: Tue Jan 11, 2011 6:57 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
Quote:
Is it possible to conditionally index an entity?

Not yet, please join the brainstorming with your use case and suggestions: HSEARCH-471

Quote:
If I have millions of rows in a database and I only want to have a subset appear in an index, how is this possible? The simplest case is that I have dates on entities and I only want entities within a specific date range to be located within an index. I don't mean 'queried'. They can't be in the index because the indexing will take far to long, and too large when a system has been brought down, or initially started.

Depending on if you're concerned on the event processing (real time index update) or the initial index creation, maybe you're more interested in HSEARCH-499 ?
But writing some code which populates initial indexes using your favourite criteria is trivial, just add some conditions before creating the scrollableresult using the old approach instead of the MassIndexer : search-batchindex-flushtoindexes

Quote:
I would like to keep a subset of data, so I can use a RAMDirectory too. Hopefully this all works well with EHCache since I have distributed cache.

That seems a good fit for the new Infinispan backend, so that you also have a distributed index.

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


Top
 Profile  
 
 Post subject: Re: Conditional Indexing Possible?
PostPosted: Tue Jan 11, 2011 7:04 pm 
Newbie

Joined: Fri Sep 29, 2006 12:00 pm
Posts: 2
Thank you very much for the response. I plan on spending some time in the morning researching your suggestions.

Edit: BTW, I never noticed the createCriteria(String) method on the fullTextSession(). I believe that is a huge part of my solution. I'd always been creating the index the 'the old way', so it is hardly a big addition to my API. That will get me around server restarts too I believe. Though I see how fast that mass indexer is. It was a huge performance boost for my tests earlier today.


Top
 Profile  
 
 Post subject: Re: Conditional Indexing Possible?
PostPosted: Wed Jan 12, 2011 10:55 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Though I see how fast that mass indexer is. It was a huge performance boost for my tests earlier today.

yes, it's supposed to be lots faster. So you should try and see if indexing all with the MassIndexer or indexing a part of it using the criteria API, what is faster depends on too many factors.

Of course, providing a patch to combine them would be the best approach: http://opensource.atlassian.com/project ... SEARCH-499
The code is trivial, it wasn't done yet as I've an hard time trying it out: so if someone could contribute it, it would be better.

_________________
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.