-->
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: Multiple indexes per a given entity
PostPosted: Wed Jan 06, 2010 6:45 am 
Newbie

Joined: Wed Jan 06, 2010 6:34 am
Posts: 8
Location: Amsterdam (NL)
Hello and Happy New Year :-)

I have the following query:
the documentation recommends NOT to split a given entity index in multiple ones... however I want to do that for
a specific reason:

I have an entity Document which needs to be indexed: a given document can only belong to a project, so
my application will deal with set of documents grouped by project.

The users will only search within a SINGLE project at the time, so I am wondering if in this case it makes
sense to split the Document index per project, so each search will open and search across the project index only
(why searching for documents in projects Alpha & Beta if the user is currently working in project Gamma??)

Any thought?
If this is a viable option how do I set (at run-time) which index must be indexed/searched?

Tnx in advance

Beppe


Top
 Profile  
 
 Post subject: Re: Multiple indexes per a given entity
PostPosted: Wed Jan 06, 2010 8:29 am 
Hibernate Team
Hibernate Team

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

We recommend index sharding only for large indexes. Your case sounds like a perfect case for a Lucene filter. Depending on the user you initialize you filter with the right project to filter on. You could probably cache in this case the filter as well as its result bitset (FilterCacheModeType.INSTANCE_AND_DOCIDSETRESULTS).
Using a filter will also make it easier two for example change across two projects in case your requirements will change.

--Hardy


Top
 Profile  
 
 Post subject: Re: Multiple indexes per a given entity
PostPosted: Fri Jan 08, 2010 9:40 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
while I agree with Hardy in recommending to avoid sharding until you're sure it's needed, you might want to play with a new feature released in latest beta:
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-251

So you still use the filter approach at API level but get the benefits of having separated indexes.

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