-->
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: Hibernate Search - manually add lucene document to an index
PostPosted: Wed Sep 10, 2008 9:58 am 
Beginner
Beginner

Joined: Tue Aug 12, 2008 9:06 am
Posts: 22
Location: Fort Washington, PA
We have several sql queries run outside of our application, and we need to be able to add a document to the lucene index after they run these queries.

If I have a pojo that is being indexed called "Utterance", can I retrieve that index in code, and then create a new lucene document and add it to the index manually?

Thanks so much.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2008 11:42 am 
Beginner
Beginner

Joined: Tue Aug 12, 2008 9:06 am
Posts: 22
Location: Fort Washington, PA
Ok I figured that out by using native lucene code.
My situation has gotten a little tougher, however.

I have the hibernate search annotations connection several pojos to add them all to the same index.

Transcript has many Lines has many Utterances

I have them all annotated so my index will have documents that look like this:

UtteranceName
UtteranceID
UtteranceID.LineID
UtteranceID.LineID.TranscriptID

That way, I'm able to perform a simple search for an Utterance, and retrieve the Lines that had that Utterance and the Transcript that has that Utterance.

My problem is that I need to specify a TranscriptID and have it crawl down the line and create documents for everything annotated like it is here.

So if I added a Transcript to my db that had 30 lines and 300 utterances that went along with it, I need all those documents created and added to the lucene index.

Is this possible??


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2008 12:28 pm 
Beginner
Beginner

Joined: Tue Aug 12, 2008 9:06 am
Posts: 22
Location: Fort Washington, PA
Nevermind I got it.

I just used persistence and my getter methods to grab the lists of object all the way down, and had nested for loops to index at the lowest level.


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.