Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 63228 invoked from network); 5 Dec 2006 21:11:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 21:11:04 -0000 Received: (qmail 35996 invoked by uid 500); 5 Dec 2006 21:11:07 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 35640 invoked by uid 500); 5 Dec 2006 21:11:05 -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 35629 invoked by uid 99); 5 Dec 2006 21:11:05 -0000 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of alicelista@gmail.com designates 66.249.82.227 as permitted sender) Received: from [66.249.82.227] (HELO wx-out-0506.google.com) (66.249.82.227) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Dec 2006 13:11:01 -0800 Received: by wx-out-0506.google.com with SMTP id i29so3811399wxd for ; Tue, 05 Dec 2006 13:09:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:in-reply-to:x-mimeole:thread-index; b=EzO7CCdh6SIFGGTMvAP78NCHaf8yH2FPPL9LV4zSD9FstXXGj1quBHMkqWrO2IK0n5ZfXGnvUVXGIWaylby95GAFjH+4/PUj96Jp8Q8IohSVgoaXss6RSHKfy78mT65S3JcYGG2mLRAv7WbPpuYdg0qFjHyU3QeA52XGjGFOARE= Received: by 10.90.81.14 with SMTP id e14mr10066342agb.1165352971882; Tue, 05 Dec 2006 13:09:31 -0800 (PST) Received: from etiopia ( [200.152.100.56]) by mx.google.com with ESMTP id 39sm21106969wrl.2006.12.05.13.09.28; Tue, 05 Dec 2006 13:09:30 -0800 (PST) From: "Alice" To: Subject: RE: Customized Analyzer Date: Tue, 5 Dec 2006 19:08:18 -0200 Message-ID: <009101c718b1$7f2ca9e0$4900000a@m4u.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <200612052158.24802@danielnaber.de> X-Mimeole: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: AccYsBF8YYWeE+C1SuipyJonyMzuYAAANzQw X-Virus-Checked: Checked by ClamAV on apache.org Ok, This is the method that adds the aliases, it is located in my = SynonymFilter: private void addAliasesToStack(Token token) { String[] synonyms =3D engine.getSynonyms("contents", token.termText()); =20 if (synonyms =3D=3D null) { return; } =20 for (int i =3D 0; i < synonyms.length; i++) { Token synToken =3D new Token(synonyms[i], = token.startOffset(), token.endOffset(), token.type()); synToken.setPositionIncrement(0); =20 modelSynonymStack.push(synToken); } } And at the Search class, the query is done like that: Query query =3D new QueryParser("contents", new SynonymAnalyzer()).parse(keyword); And the return is: contents:"(wind window)" And no hit... -----Original Message----- From: Daniel Naber [mailto:lucenelist2005@danielnaber.de]=20 Sent: ter=E7a-feira, 5 de dezembro de 2006 18:58 To: java-user@lucene.apache.org Subject: Re: Customized Analyzer On Tuesday 05 December 2006 21:37, Alice wrote: > It does not work. > > Even with the synonyms indexed it is not found. So if your text contains "wind" it is not found by the query that prints = as=20 content:"(wind window)"? Then I suggest you post a small test case that=20 shows this problem. As Chris said, calling setPositionIncrement(0) is=20 important. Regards Daniel --=20 http://www.danielnaber.de --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org