Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 45325 invoked from network); 12 Apr 2009 13:31:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Apr 2009 13:31:18 -0000 Received: (qmail 1234 invoked by uid 500); 12 Apr 2009 13:31:16 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 1151 invoked by uid 500); 12 Apr 2009 13:31:16 -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 1140 invoked by uid 99); 12 Apr 2009 13:31:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Apr 2009 13:31:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Apr 2009 13:31:07 +0000 Received: by ehatchersolutions.com (Postfix, from userid 504) id A06B130EFC14; Sun, 12 Apr 2009 07:30:46 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on javelina X-Spam-Level: Received: from [10.0.1.193] (unknown [138.210.8.79]) by ehatchersolutions.com (Postfix) with ESMTP id 0C20730EFC12 for ; Sun, 12 Apr 2009 07:30:43 -0600 (MDT) Message-Id: From: Erik Hatcher To: java-user@lucene.apache.org In-Reply-To: <499888440904120515t7f7516a1m81615f4b56db3c29@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 v930.3) Subject: Re: Sequential match query Date: Sun, 12 Apr 2009 09:30:43 -0400 References: <22995240.post@talk.nabble.com> <359a92830904110925m24dda294l343ad947acb3ea43@mail.gmail.com> <499888440904111811j34e4bf3clab0de3a176215363@mail.gmail.com> <07E17CDF-6BA8-4919-BD23-AA81351ABC01@ehatchersolutions.com> <499888440904120515t7f7516a1m81615f4b56db3c29@mail.gmail.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.1 On Apr 12, 2009, at 8:15 AM, Tim Williams wrote: > On Sun, Apr 12, 2009 at 5:56 AM, Erik Hatcher > wrote: >> >> On Apr 11, 2009, at 9:11 PM, Tim Williams wrote: >> >>> On Sat, Apr 11, 2009 at 12:25 PM, Erick Erickson >>> wrote: >>>> >>>> That'll teach me to scan a post. The link I sent you >>>> is still relevant, but wildcards are NOT intended to be used to >>>> concatenate terms. You want a phrase query or a span query >>>> for that. i.e. "A C F"~# where # is the "slop", that is, the number >>>> of other terms allowed to appear between your desired terms. >>>> >>>> SpanQueries are constructed programmatically, and PhraseQueries >>>> are produced by the parser. >>> >>> As I understand it though, there's no way to use the queryparser to >>> construct an *ordered* phrase query with slop (which is what I think >>> he's after), right? I gather that'd have to be done manually with a >>> SpanNearQuery. I'd love to hear that the query parser has syntax >>> for >>> this though... >> >> QueryParser does not create any SpanQuery's, but one can subclass >> QueryParser and override getFieldQuery() to put in a SpanQuery >> instead of a >> PhraseQuery. > > Thanks Erik, wouldn't this be an all-or-nothing replacement though? > In other words, by creating ordered SpanNearQuery's as the override, > wouldn't he loose the current unordered PhraseQuery+slop > functionality? I haven't seen a way to subclass the QueryParser to > support both (e.g. extend the syntax)? As always, it depends. If the QueryParser subclass has a switch to toggle between SpanNearQuery and PhraseQuery it could controlled by the code which way to go. But yeah, it's not currently possible to extend the syntax of QueryParser with a subclass. There is a nice new open issue with a new query parser implementation that is vastly more flexible - we'll see that come in to Lucene in the near future. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org