Oh my...disregard this question. It works...I was instantiating my IndexWriter before setting up my Analyzers!! Dangit...I feel a little dumb. I just switched the order and put the instantiated indexwriter last...it works.

Thanks,
Michael

P.S.  I feel somewhat silly!

Michael J. Prichard wrote:

So I have the following code...

// let's get our SynonymAnalyzer
SynonymAnalyzer synAnalyzer = getSynonymAnalyzer();
// let's get our EmailAnalyzer
EmailAnalyzer emailAnalyzer = getEmailAnalyzer();

// set up perfieldanalyzer
PerFieldAnalyzerWrapper aWrapper = new PerFieldAnalyzerWrapper(new StandardAnalyzer()); aWrapper.addAnalyzer("subject", synAnalyzer);
aWrapper.addAnalyzer("content", synAnalyzer);
aWrapper.addAnalyzer("from", emailAnalyzer);
aWrapper.addAnalyzer("to", emailAnalyzer);
aWrapper.addAnalyzer("cc", emailAnalyzer);
aWrapper.addAnalyzer("bcc", emailAnalyzer);

// create the writer
try {
   wr = new IndexWriter(indexDir, aWrapper, false);
   wr.setUseCompoundFile(false);
} catch (IOException iox) {
   // means it ain't there
   wr = new IndexWriter(indexDir, aWrapper, true);
   wr.setUseCompoundFile(false);
}

-----

When I add a Document to the IndexWriter it does not seem to use the analyzer's I want it too. Just uses StandardAnalyzer for everythign! Is this the correct way to use PerFieldAnalyzerWrapper?

Thanks,
Michael

P.S.  I am using Lucene 2 libs.

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



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

Reply via email to