Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 13063 invoked from network); 28 Jul 2003 12:56:36 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 28 Jul 2003 12:56:36 -0000 Received: (qmail 21816 invoked by uid 97); 28 Jul 2003 12:59:11 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 21809 invoked from network); 28 Jul 2003 12:59:11 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 28 Jul 2003 12:59:11 -0000 Received: (qmail 10608 invoked by uid 500); 28 Jul 2003 12:56:09 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 10533 invoked from network); 28 Jul 2003 12:56:08 -0000 Received: from mail4.atl.registeredsite.com (64.224.219.78) by daedalus.apache.org with SMTP; 28 Jul 2003 12:56:08 -0000 Received: from netmail.mail.registeredsite.com ([216.122.69.15]) by mail4.atl.registeredsite.com (8.12.9/8.12.9) with ESMTP id h6SCu617019689 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Mon, 28 Jul 2003 08:56:07 -0400 Received: (qmail 5816 invoked by uid 89); 28 Jul 2003 12:58:09 -0000 Received: from unknown (HELO ehatchersolutions.com) (128.143.103.8) by mail.neolitetechnologies.com with SMTP; 28 Jul 2003 12:58:09 -0000 Date: Mon, 28 Jul 2003 05:56:09 -0700 Subject: Re: Different Analyzer for each Field Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Erik Hatcher To: "Lucene Users List" Content-Transfer-Encoding: 7bit In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.552) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Monday, July 28, 2003, at 01:32 AM, Claude Libois wrote: > My question is in the title: how can I use a different Analyzer for > each field of a Document object? My problem is that if I use > LetterTokenizer for a field which contains a String representation of > a number, after I can't delete it. Probably because this analyzer > threw away my number. So I need to use whitespaceTokenizer for this > field but I would like to use LetterTokenizer for the other. Can > someone help me? > thank you My recommendation is to write a custom Analyzer subclass that uses the field name on the tokenStream method to effect the internals of the analysis process. Just rip out the internals of the analyzers you want to piece together into your own analyzer that has the logic you want. Erik p.s. You may need to use a CVS version of Lucene for this feature? --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org