lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Lu" <chris...@gmail.com>
Subject Re: How to make a query that associates 2 index files
Date Tue, 06 May 2008 16:38:56 GMT
No easy way unless you merge your 2 indexes into:

Index:      [who]    [accessed]   [key]          [content]


            David    1/1/2007     Abc            "blah blah 123 ..."

            Someone  1/2/2005     Abc            "blah blah 123 ..."

            Guess    12/1/2000    Xyz            "123 321 a nice day ..."

            Harry    1/1/2008     Abc            "blah blah 123 ..."

            Sandra   1/1/2003     Xyz            "123 321 a nice day ..."


Anyway, Lucene index is more like Database Index. It's only efficient for
particular query execution paths.
If you have special requirements, you will have to re-structure your index
for performance.

-- 
Chris Lu
-------------------------
Instant Scalable Full-Text Search On Any Database/Application
site: http://www.dbsight.net
demo: http://search.dbsight.com
Lucene Database Search in 3 minutes:
http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes
DBSight customer, a shopping comparison site, (anonymous per request) got
2.6 Million Euro funding!

On Tue, May 6, 2008 at 9:14 AM, Michael Siu <michaelysiu@hotmail.com> 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
>
>
>
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message