I don't think that there are good-and-simple solutions for these kind of 
problems
[first make a search on indexA, then using the results, make a second search on 
indexB].


1- If the first search returns more than "max-term" results, then second search 
will throw an exception.
2- To avoid the exception, setting max-term ,for ex, to MaxInt would mean 
storing all results(not only top n results) of the first search(which can be 
very huge) in memory, and also degrading the performance of the second 
search.(using "Hits" object can also be a nightmare in this situation. See 
http://wiki.apache.org/lucene-java/ImproveSearchingSpeed )
3- Depending on the nature of the data, choosing the right index to perform the 
first search can be very tricky, and starting the search with the wrong index 
can VERY-badly effect the overall search performance.

DIGY


-----Original Message-----
From: Michael Garski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 06, 2008 8:44 PM
To: lucene-net-user@incubator.apache.org
Subject: RE: How to perform search within Search Results recursively

Michael,

This sort of association between to indexes can be done, but is not natively 
supported in Lucene.  One solution that comes to mind would be to only have one 
index, adding the [content] field to Index_2 and omitting the [key] field all 
together.  This would result in duplication of indexed data, but I don't think 
of an index as being normalized like a database.

If you wanted to stay with the 2 index format, you would need to run two 
separate queries:

1) find [key] associated with [content] in Index_1 that contains the term 'blah'

2) query Index_2 with the following boolean clauses:
        +[who] is in range of 'David' to 'Guess'
        +[accessed] in range '1/1/1900' to '1/1/2010'
        +[key] found in querying Index_1

Michael

-----Original Message-----
From: Michael Siu [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 06, 2008 8:37 AM
To: lucene-net-user@incubator.apache.org
Subject: RE: How to perform search within Search Results recursively

Thanks for the reply.

On the other hand, how to do a query for the following situation:

- 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.


-----Original Message-----
From: Digy [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 05, 2008 11:53 AM
To: lucene-net-user@incubator.apache.org
Subject: RE: How to perform search within Search Results recursively

It can be done with "ANDing the new query with the previous one" (like
google does).

DIGY

-----Original Message-----
From: Michael Siu [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 05, 2008 9:43 PM
To: lucene-net-user@incubator.apache.org
Subject: How to perform search within Search Results recursively

Hi,

I am a newbie to Lucene and Lucene.net. I am wondering if it is possible to
perform search within search results recursively. That means if I initially
perform a search on all fields in a query string. Then I want to perform
another query string on the search results from the previous search and so
on. This is similar to search within results in Google. How is it possible
to perform search like this with Lucene or Lucene.net?

Thanks in advance.

-m



Reply via email to