Thank you for your answer Grant.
I already have a similar architecture than yours, allowing me do retrieve the analyzer used for a specific index. But how does it solve the problem of doing one search on multiple indices using multiple analyzer ?

I'm not sure I was enough clear when asking my question.

Currently here is what can be done using the MultiSearcher;
 // let's pretend for the example that we deal with two languages index,
 // Directory indexDirEn, Directory indexDirEn;
Searcher[] searchers = { new IndexSearcher(indexDirEN), new IndexSearcher(indexDirFR) };
 MultiSearcher searcher = new MultiSearcher(searchers);
 Query query = QueryParser.parse(queryStr, "defaultfield", theAnalyzer));
 Hits hits = searcher.search(query);
As you can see, we user the same analyzer "theAnalyzer" for all indices, this is of course a bad idea because each of the indices have been fill using a dedicated analyzer.

What I'd like to do is more something like this:
Searcher[] searchers = { new IndexSearcher(indexDirEN), new IndexSearcher(indexDirFR) };
 Analyzer[] analyzers = { enAnalyzer, frAnalyzer };
 MultiSearcher searcher = new MultiSearcher(searchers);
 Query query = QueryParser.parse(queryStr, "defaultfield", analyzers));
 Hits hits = searcher.search(query);
(I undesrstand this code makes no sense, it's just to show that I want to specify as many analyzer as there are indices).

Any suggestions?

Olivier

Grant Ingersoll wrote:

I store an Index (not part of Lucene) object w/ the Lucene index that
contains a bunch of metadata about the index, one being the name of the
Analyzer used (other things include the language of the Index, which
field contains a unique document identifier (not the internal Lucene
id), etc.  Then at search time, I just get an new instance of that
Analyzer and pass it to the query parser and do my searches.  Then you
just need a mechanism for managing your Index, which is pretty
straightforward (hash by location or something like that)





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to