FAQ
My problem is: the [content] value can be huge. Duplicating it in more than
one index document waste disk space (and search time?). In additions, when
new documents are added to the second index, it will be faster to just index
the linked [content] once (in first index file) and any subsequent reference
to the same [content] will not need to re-index.

In fact, I do not really need to physically separate the indices into 2
files because Lucene supports Heterogeneous documents in an index file. I
have no idea of how that work in a search. Does anyone know?

Thanks in advance.



-----Original Message-----
From: Erick Erickson
Sent: Tuesday, May 06, 2008 9:36 AM
To: java-user@lucene.apache.org
Subject: Re: How to make a query that associates 2 index files

You don't. You really have to roll your own solution here, there's
no "inter-index" awareness that I know of in Lucene.

Typically, people either do a half-half solution (that is, put the
text search in Lucene and leave the DB parts in the DB) or
de-normalize the data in a Lucene index so you don't have
to even try to do things cross-index.

And then there's Marcelo Ochoa (I may have the spelling wrong) who's
put together some way to embed Lucene in an Oracle database, but
that's magic to me.

Why do you want to arrange your index this way in the first place?
Perhaps there's a more specific answer waiting out there...

Best
Erick
On Tue, May 6, 2008 at 12:14 PM, Michael Siu wrote:

Hi,



I am a newbie to Lucene. I have a question for making a query that
associate
2 index files:



- One index has the content index for a list of documents and a key to the
document. That means the Lucene document of this index contains 2 fields:

the 'content' and the 'key'.

- another index has the some data indexed associated with the 'key' in the
previous index. The Lucene document of this index contains several fields:

the 'who' that contains some data and the 'key' that _points_ to the
document in the first index.



Sample data:

Index_1: [key] [content]

Abc "blah blah 123 ..."

Xyz "123 321 a nice day ..."



Index_2: [who] [accessed] [key]

David 1/1/2007 Abc

Someone 1/2/2005 Abc

Guess 12/1/2000 Xyz

Harry 1/1/2008 Abc

Sandra 1/1/2003 Xyz



As shown, the [key] field in Index_2 has repeated value that _points_ to
the
[key] values in Index_1. How do I make a query for the following:



Find out all documents in Index_2:

- [who] is in range of 'David' to 'Guess' and

- [accessed] in range '1/1/1900' to '1/1/2010' and

- [key] associated [content] in Index_1 that contains the term 'blah'



I know this is more SQL like query. Is Lucene capable of doing this type
of
query that needs associations among index files?



Thanks in advance.



- m







---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 6 | next ›
Discussion Overview
groupjava-user @
categorieslucene
postedMay 6, '08 at 4:14p
activeMay 7, '08 at 12:02a
posts6
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase