FAQ
IndexReader index1 = IndexReader.open(dir1);
IndexReader index2 = IndexReader.open(dir2);
IndexReader index3 = IndexReader.open(dir3);
...
IndexReader all = new MultiReader(index1, index2, index3,...);
IndexSearcher searcher = new IndexSearcher(all);

...search your indexes...

all.close();
index1.close();
index2.close();
index3.close();
...


-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
-----Original Message-----
From: Cheng
Sent: Thursday, June 23, 2011 4:19 PM
To: java-user@lucene.apache.org
Subject: Search multiple directories simultaneously

Hi,

I have multiple indexed folders (or directories), each holding indexing files
for specific purposes. I want to do a search over these folders (or
directories) in a same query.

Is it possible?

Thanks

---------------------------------------------------------------------
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 | 2 of 3 | next ›
Discussion Overview
groupjava-user @
categorieslucene
postedJun 23, '11 at 2:19p
activeJun 23, '11 at 6:23p
posts3
users2
websitelucene.apache.org

2 users in discussion

Cheng: 2 posts Uwe Schindler: 1 post

People

Translate

site design / logo © 2022 Grokbase