From java-user-return-16160-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Thu Sep 01 15:11:08 2005 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 33824 invoked from network); 1 Sep 2005 15:11:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Sep 2005 15:11:07 -0000 Received: (qmail 28152 invoked by uid 500); 1 Sep 2005 15:11:01 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 28071 invoked by uid 500); 1 Sep 2005 15:11:00 -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 28057 invoked by uid 99); 1 Sep 2005 15:11:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2005 08:11:00 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [207.69.200.58] (HELO pop05.mail.atl.earthlink.net) (207.69.200.58) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2005 08:11:13 -0700 Received: from mswamui-thinleaf.atl.sa.earthlink.net ([209.86.224.51]) by pop05.mail.atl.earthlink.net with esmtp (Exim 3.36 #10) id 1EAqiO-0007iG-00 for java-user@lucene.apache.org; Thu, 01 Sep 2005 11:10:56 -0400 Message-ID: <14011144.1125587456484.JavaMail.root@mswamui-thinleaf.atl.sa.earthlink.net> Date: Thu, 1 Sep 2005 10:10:56 -0500 (GMT-05:00) From: Andrew Boyd Reply-To: Andrew Boyd To: java-user@lucene.apache.org Subject: Re: Should I use span query? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Earthlink Zoo Mail 1.0 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N If I do a proximity search "terma termb"~10 that will get me the documents that have terma within 10 words of termb. But how can I get all the terms > that are within x number of > terms of given query terms. instead of just the documents. Thanks, Andrew -----Original Message----- From: Erik Hatcher Sent: Aug 26, 2005 3:23 PM To: java-user@lucene.apache.org Subject: Re: Should I use span query? On Aug 26, 2005, at 4:11 PM, Andrew Boyd wrote: > Hi All, > I'm trying to find all the terms that are within x number of > terms of given query terms. Should I be using span query or > something else. If you have any code samples I would greatly > appreciated it. PhraseQuery, or "termA termB"~10 syntax with QueryParser, provides term distance capability as well. SpanNearQuery certainly will do the trick, and has an advantage over PhraseQuery in that it can be ordered or unordered whereas PhraseQuery is always irrelevant of order. There are code examples in the Lucene in Action code found at http:// www.lucenebook.com By the way, did you see we got slashdotted? Erik --------------------------------------------------------------------- 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