-->
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: mixing hibernate search with pure lucene indexing.
PostPosted: Sun Jun 22, 2008 2:33 pm 
Regular
Regular

Joined: Tue Apr 01, 2008 5:39 pm
Posts: 61
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.2.6 GA
Mapping documents:

I have a class "foo" that is indexed using pure lucene indexing because is a third party jar file.

Than i have class bar that has foo as a many-to-one foreign key. How do i indexed

@Indexed (index="Bar")
class Bar
{
@DocumentId
Integer id;

private Foo foo;
}

What do i do for foo?

I am using 3.0.0


Top
 Profile  
 
 Post subject: Re: mixing hibernate search with pure lucene indexing.
PostPosted: Sun Jun 22, 2008 3:22 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
cablepuff wrote:
I have a class "foo" that is indexed using pure lucene indexing because is a third party jar file.

I am not quite sure what you mean with that? Did you write your own indexing framework? Can you maybe elaborate what you mean?

cablepuff wrote:
Than i have class bar that has foo as a many-to-one foreign key. How do i indexed

@Indexed (index="Bar")
class Bar
{
@DocumentId
Integer id;

private Foo foo;
}

What do i do for foo?

Normally you would index Foo as @IndexedEmbedded, but this implies that you also annotate the indexable fields in Foo. However, you say Foo is part of an external library? How does this work really? How is Foo mapped on an entity level if you don't have control over it?

Maybe you could write a own wrapper class for Foo which you then can annotate?

--Hardy


Top
 Profile  
 
 Post subject: Re: mixing hibernate search with pure lucene indexing.
PostPosted: Sun Jun 22, 2008 4:01 pm 
Regular
Regular

Joined: Tue Apr 01, 2008 5:39 pm
Posts: 61
hardy.ferentschik wrote:
cablepuff wrote:
I have a class "foo" that is indexed using pure lucene indexing because is a third party jar file.

I am not quite sure what you mean with that? Did you write your own indexing framework? Can you maybe elaborate what you mean?

cablepuff wrote:
Than i have class bar that has foo as a many-to-one foreign key. How do i indexed

@Indexed (index="Bar")
class Bar
{
@DocumentId
Integer id;

private Foo foo;
}

What do i do for foo?

Normally you would index Foo as @IndexedEmbedded, but this implies that you also annotate the indexable fields in Foo. However, you say Foo is part of an external library? How does this work really? How is Foo mapped on an entity level if you don't have control over it?

Maybe you could write a own wrapper class for Foo which you then can annotate?

--Hardy


1.) What i mean is foo is already indexed using combination of keyword analyzer and index writer and export it as service in jar file. The index generation of foo will be made by periodic batch.
2.) Hmm create a wrapper class, isn't that code duplication? Its something i want to avoid.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 23, 2008 2:35 am 
Hibernate Team
Hibernate Team

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

do you not have some code duplication anyway? Or if not code duplication you still have to manage two different ways of indexing and searching. Once via the service and once with Hibernate Search. That might be be necessary for your use case, but with a thin wrapper you could maybe just switch to Hibernate Search and handle all indexing and searching with it? Or maybe the other way around? Can the provided service be extended to not only index Foo?

--Hardy


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.