looking into the code I found out that the Analyzer defined in the constructor is the one that will be used when you call AddDocument without an Analyzer (default Analyzer). So if you specify a different analyzer when calling AddDocument you will use the one you specified instead of the one passed to the constructor. So yes, you can use different analyzers.
You can also define an Analyzer when searching because you have to tokenize and filter your search input in order to be able to search accurately in the index. On Thu, Apr 24, 2008 at 3:39 AM, Sudhanya Chatterjee < [EMAIL PROTECTED]> wrote: > Hi, > > > > While creating an IndexWriter constructor takes Analyzer as one of the > parameter. > > Even while calling AddDocument on IndexWriter we can specify the analyzer. > > What is the difference between these two? > > If we specify two different Analyzers at these two instances, which > Analyzer > will be finally used? > > If we don't specify any Analyzer at the time of calling AddDocument what is > the behaviour expected? > > While adding lucene document to index we can specify the analyzer even > while > searching, what is the difference between these two? > > Should both the Analyzers be same or they can differ? > > > > Thanks, > > Sudhanya > > > DISCLAIMER > ========== > This e-mail may contain privileged and confidential information which is > the property of Persistent Systems Ltd. It is intended only for the use of > the individual or entity to which it is addressed. If you are not the > intended recipient, you are not authorized to read, retain, copy, print, > distribute or use this message. If you have received this communication in > error, please notify the sender and delete all copies of this message. > Persistent Systems Ltd. does not accept any liability for virus infected > mails. >