Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 38624 invoked from network); 8 Feb 2006 01:18:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Feb 2006 01:18:32 -0000 Received: (qmail 12553 invoked by uid 500); 8 Feb 2006 01:18:26 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 12517 invoked by uid 500); 8 Feb 2006 01:18:25 -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 12506 invoked by uid 99); 8 Feb 2006 01:18:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2006 17:18:25 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2006 17:18:25 -0800 Received: by ehatchersolutions.com (Postfix, from userid 504) id 9D5DE33D2DA; Tue, 7 Feb 2006 20:18:04 -0500 (EST) Received: from [172.16.1.101] (va-71-48-129-167.dhcp.sprint-hsd.net [71.48.129.167]) by ehatchersolutions.com (Postfix) with ESMTP id 2D39C33D2D1 for ; Tue, 7 Feb 2006 20:18:03 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v746.2) In-Reply-To: <20060207210651.66698.qmail@web86507.mail.ukl.yahoo.com> References: <20060207210651.66698.qmail@web86507.mail.ukl.yahoo.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1487F818-696E-4CA9-9FD9-DEC115E61529@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: How can you simulate inOrder in boolean queries Date: Tue, 7 Feb 2006 20:17:59 -0500 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.746.2) X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on javelina X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The source code to Lucene in Action (www.lucenebook.com) has an example of extending the built-in QueryParser to use SpanNearQuery for in-order phrase searching instead of the default unordered PhraseQuery behavior. That example will show how to use SpanNearQuery made up of SpanTermQuery's. The source code to QueryParser shows how to use PhraseQuery directly, if all you want is an example. Also as Paul mentioned, the test cases in Lucene's source code make great ways to learn how Lucene's API works. If what you're trying to do is put an in-order wrapper around all of the query types you mentioned, you will have a fair bit more work to do in order to create a parser that can create a SpanNearQuery with SpanRegexQuery's (new in contrib's trunk), and there currently is not a SpanQuery version of FuzzyQuery that I'm aware of. Erik On Feb 7, 2006, at 4:06 PM, RONALD MANTAY wrote: > Hi, can any one help, I am new to lucene. > > Due to requiring a specific Query syntax, I have created a > bespoke query parser to build a boolean query which at any time may > comprising a mixture of : > > a) Fuzzy terms with similarity level set according to length of > term.text > b) Wild Card Querys > c) Term Querys > > I would like to ability to define if the Query parser terms > require to be in Order or not (but when in order to allow gaps in > the term positions). > > I can not see see how I can use PhraseQuery or SpanNearQuery > directly, can anyone point me in the right direction in how to > simulate inOrder to boolean queries. > > Any help will be appreciated. > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org