Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 65851 invoked from network); 13 Mar 2008 11:54:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2008 11:54:28 -0000 Received: (qmail 10370 invoked by uid 500); 13 Mar 2008 11:54:19 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 10333 invoked by uid 500); 13 Mar 2008 11:54:19 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 10322 invoked by uid 99); 13 Mar 2008 11:54:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Mar 2008 04:54:19 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [208.97.132.66] (HELO spunkymail-a20.g.dreamhost.com) (208.97.132.66) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Mar 2008 11:53:40 +0000 Received: from [192.168.0.3] (adsl-074-229-189-244.sip.rmo.bellsouth.net [74.229.189.244]) by spunkymail-a20.g.dreamhost.com (Postfix) with ESMTP id BD865E24E2 for ; Thu, 13 Mar 2008 04:53:48 -0700 (PDT) Message-Id: <39A5C7D6-7BBE-400D-B1A9-0D5822F13027@apache.org> From: Grant Ingersoll To: java-user@lucene.apache.org In-Reply-To: <8837fb770803121740v38537069sf5eba01e284dbbc2@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: indexing api wrt Analyzer Date: Thu, 13 Mar 2008 07:53:48 -0400 References: <8837fb770803121740v38537069sf5eba01e284dbbc2@mail.gmail.com> X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org On IndexWriter, you can pass in the Analyzer when you add a Document, thus your application can identify the language, choose the analyzer for the given doc, and then add the document See public void addDocument(Document doc, Analyzer analyzer) On Mar 12, 2008, at 8:40 PM, John Wang wrote: > Hi all: > > Maybe this has been asked before: > > I am building an index consists of multiple languages, (stored as a > field), and I have different analyzers depending on the language of > the > language to be indexed. But the IndexWriter takes only an Analyzer. > > I was hoping to have IndexWriter take an AnalyzerFactory, where the > AnalyzerFactory produces Analyzer depending on some criteria of the > document, e.g. language. > > Maybe I am going about the wrong way. > > Any suggestions on how to go about? > > Thanks > > -John -------------------------- Grant Ingersoll http://www.lucenebootcamp.com Next Training: April 7, 2008 at ApacheCon Europe in Amsterdam Lucene Helpful Hints: http://wiki.apache.org/lucene-java/BasicsOfPerformance http://wiki.apache.org/lucene-java/LuceneFAQ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org