Here is the code that I use to do multi-index searches:

// create a multi index searcher
IndexSearcher indexes[] = new IndexSearcher[n]; // where n is the number of indexes to search


for (int i = 0; i < n; i++)
{
        // use whichever IndexSearcher constructor you want
        // blah is the appropriate value to pass
        indexes[i] = new IndexSearcher(blah);
}

// This is the part which allows you to search multiple indexes
Searcher searcher = new MultiSearcher(indexes);

// do the search
Analyzer analyzer = new StandardAnalyzer();
Query query = QueryParser.parse(expression, colSearch, analyzer);

searcher.search(query);


At 01:19 PM 20/07/2004, you wrote:
Hi,
i want to join two lucene indexes but i dont know how to do that.

For example i have a student index and a school index.
In the scholl index i have the studentId field.


How to do that ? Any idea will be wellcomed. Thx, Sergio.

Don Vaillancourt Director of Software Development

WEB IMPACT INC.
416-815-2000 ext. 245
email: [EMAIL PROTECTED]
web: http://www.web-impact.com




This email message is intended only for the addressee(s) and contains information that may be confidential and/or copyright. If you are not the intended recipient please notify the sender by reply email and immediately delete this email. Use, disclosure or reproduction of this email by anyone other than the intended recipient(s) is strictly prohibited. No representation is made that this email or any attachments are free of viruses. Virus scanning is recommended and is the responsibility of the recipient.













Reply via email to