-->
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.  [ 6 posts ] 
Author Message
 Post subject: Search index directory prefix
PostPosted: Mon Jun 01, 2009 2:58 pm 
Newbie

Joined: Mon Jun 01, 2009 2:30 pm
Posts: 5
We have approx 500 customers, each with their own virtual database. We are implementing Hibernate Search, and would like the keep their Lucene indexes separate, as well.

Ideally, the indexes would be stored in $indexBase/$customerID/$entityName. In Hibernate Search, it seems that I can set an indexBase (via .properties), and an entityName (via @Indexed), but I can't break out the indexes by customer.

We don't need to query multiple customers at once. What would be a good solution in this case?

1. Leave everything in one index, using filters to get data back for a single customer.
2. Implement a custom DirectoryProvider. How do we get access to the current entity object from there?
3. Implement sharding. Is it possible to implement index sharding, but not database sharding?


Top
 Profile  
 
 Post subject: Re: Search index directory prefix
PostPosted: Tue Jun 02, 2009 3:33 am 
Hibernate Team
Hibernate Team

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

I definitely would choose the Filter approach. It will fulfill your requirements w/o the need of extending Hibernate Search itself. The online documentation and also "Hibernate Search in Action" have examples for your use case.

--Hardy


Top
 Profile  
 
 Post subject: Re: Search index directory prefix
PostPosted: Wed Jun 03, 2009 10:29 am 
Newbie

Joined: Mon Jun 01, 2009 2:30 pm
Posts: 5
Thanks for the response,

I was able to implement a Filter prototype very quickly. However, we are worried about having all the customers on one index. The load experience by that one index is unnecessarily high, and if the index becomes corrupted it will take down all customers instead of just one customer.

I was also able to prototype a custom DirectoryProvider which receives state on which index to use via a Property object passed in from the caller. However, the Hibernate Search code caches the mapping of entity to index, so we would need to modify the core code if we wanted to continue to use that mechanism.

I also bought "Hibernate Search in Action", and read up on sharding. It would seem that we could shard by customer fairly easily for indexing. But for searching, every index will be queried, which is not what we want.

We are seriously considering creating a local patch for Hibernate Search, which I generally loath to do.


Top
 Profile  
 
 Post subject: Re: Search index directory prefix
PostPosted: Wed Jun 03, 2009 12:18 pm 
Newbie

Joined: Mon Jun 01, 2009 2:30 pm
Posts: 5
I have found the request HSEARCH-251, http://opensource.atlassian.com/project ... SEARCH-251, which would limit searches to a single shard. This appears to be what I want. I'll join the dev discussion.


Top
 Profile  
 
 Post subject: Re: Search index directory prefix
PostPosted: Thu Jun 04, 2009 3:22 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Great. We also always need a helping hand ;-)


Top
 Profile  
 
 Post subject: Re: Search index directory prefix
PostPosted: Fri Jun 12, 2009 4:16 pm 
Newbie

Joined: Mon Jun 01, 2009 2:30 pm
Posts: 5
FYI - There is a fix into trunk on that issue. You can now use a Filter to decide which shards to search against in your indexing strategy.


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