Return-Path: X-Original-To: apmail-lucene-general-archive@www.apache.org Delivered-To: apmail-lucene-general-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 872D99367 for ; Mon, 28 Nov 2011 07:41:02 +0000 (UTC) Received: (qmail 80043 invoked by uid 500); 28 Nov 2011 07:41:00 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 79418 invoked by uid 500); 28 Nov 2011 07:40:59 -0000 Mailing-List: contact general-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@lucene.apache.org Delivered-To: mailing list general@lucene.apache.org Received: (qmail 79407 invoked by uid 99); 28 Nov 2011 07:40:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 07:40:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of uwe@thetaphi.de designates 188.138.97.18 as permitted sender) Received: from [188.138.97.18] (HELO mail.sd-datasolutions.de) (188.138.97.18) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 07:40:50 +0000 Received: from VEGA (port-92-196-37-159.dynamic.qsc.de [92.196.37.159]) by mail.sd-datasolutions.de (Postfix) with ESMTPSA id E6EDC14AA250 for ; Mon, 28 Nov 2011 07:40:29 +0000 (UTC) From: "Uwe Schindler" To: References: <004d01ccad9c$9ed9f790$dc8de6b0$@comcast.net> In-Reply-To: <004d01ccad9c$9ed9f790$dc8de6b0$@comcast.net> Subject: RE: MaxFieldLength in Lucene 3.4 Date: Mon, 28 Nov 2011 08:40:50 +0100 Message-ID: <001601ccada1$0d5fbde0$281f39a0$@thetaphi.de> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFIDc80bskyhLxfAFOHGpsHysVV0ZbLIz4g Content-Language: de X-Virus-Checked: Checked by ClamAV on apache.org Hi, The move is simple - LimitTokenCountAnalyzer is just a wrapper around any other Analyzer, so I don't really understand your question - of course all other analyzers are unlimited. If you have myAnalyzer with myMaxFieldLengthValue used before, you can change your code as follows: Before: new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_34, myAnalyzer).setFoo().setBar().setMaxFieldLength(myMaxFieldLengthValue)); After: new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_34, new LimitTokenCountAnalyzer(myAnalyzer, myMaxFieldLengthValue)).setFoo().setBar()); You only have to do this on the indexing side, on the query side (QueryParser) just use myAnalyzer without wrapping. With the new code, the responsibilities for cutting the field after a specific number of tokens was moved out out the indexing code in Lucene. This is now just an analysis feature not a indexing feature anymore. ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: Joe MA [mailto:mrjama@comcast.net] > Sent: Monday, November 28, 2011 8:09 AM > To: general@lucene.apache.org > Subject: MaxFieldLength in Lucene 3.4 > > While upgrading to Lucene 3.4, I noticed the MaxFieldLength values on the > indexers are deprecated. There appears to be a LimitTokenCountAnalyzer > that limits the tokens - so does that mean the default for all other analyzers is > unlimited? > > Thanks in advance - > JM