-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate search config
PostPosted: Wed Jul 16, 2008 4:41 am 
Newbie

Joined: Tue May 20, 2008 11:14 am
Posts: 7
Hi,
I'm working in a multilinguisme environnement and I'm using Hibernate search to index some documents.
Those documents are in different languages.
And at the end I want one index per language ex: index_en, index_fr,index_bg,...
if I have 23 index I need to create 23 classes with the annotation @index(name="index_xx")?
There is no other way to solve this?
Thanks in advence.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 16, 2008 6:13 am 
Hibernate Team
Hibernate Team

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

Your description of your requirements are quite vague, but why would you like to split the indexes? Do you want to search over all these indexes at the same time? Why can you not just index all data into one single index? However, you are correct that the index name is defined on entity level.

Maybe you could provide a little bit more information about your use case.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 16, 2008 8:02 am 
Newbie

Joined: Tue May 20, 2008 11:14 am
Posts: 7
I have a class like this one:

public class Document {

private String path;

private String lang;

private String content;
}

And at the end I need to have one index by laguague:

index_en
index_fr
....

For the moment I have add this annotation to the class Document
@Indexed (name="index_en") so each Document I retrieved are stored in the index 'index_en'.
I found a solution: I create one class per language who extends de class document.
So at the end I have the same number of class as I have language (if I have 23 languages I have 23 different class who do the same things)
My question his is it possible to configure hibernate to have only one class?
If I don't index all data into one single index it's because if the index is corrupted I only need to re-index one part and not the entire index


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 16, 2008 3:32 pm 
Hibernate Team
Hibernate Team

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

I guess your subclass approach is possible, but is this a good design? You are basically hard coding the language into the class name. This way you are loosing generality. Is this worth the benefit of having separate index files? You can always reindex selectively if the index is out of date.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 17, 2008 2:04 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Using the index sharding feature should solve your problem.
not sure why you want to split the index through

_________________
Emmanuel


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