Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 50734 invoked from network); 11 Nov 2004 10:06:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Nov 2004 10:06:09 -0000 Received: (qmail 45177 invoked by uid 500); 11 Nov 2004 10:06:06 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 44844 invoked by uid 500); 11 Nov 2004 10:06:05 -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 44829 invoked by uid 99); 11 Nov 2004 10:06:04 -0000 Received-SPF: pass (hermes.apache.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 11 Nov 2004 02:06:04 -0800 Received: by ehatchersolutions.com (Postfix, from userid 504) id 2382B13E28FB; Thu, 11 Nov 2004 05:05:54 -0500 (EST) Received: from [192.168.1.101] (va-chrvlle-cad1-bdgrp1-4b-b-169.chvlva.adelphia.net [68.169.41.169]) by ehatchersolutions.com (Postfix) with ESMTP id CA04113E200B for ; Thu, 11 Nov 2004 05:05:42 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <005b01c4c799$674e1270$32e0fcca@satoshiobtu4n6> References: <005b01c4c799$674e1270$32e0fcca@satoshiobtu4n6> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <4FF070AE-33C9-11D9-B46A-000393A564E6@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Query#rewrite Question Date: Thu, 11 Nov 2004 05:06:10 -0500 To: "Lucene Users List" X-Mailer: Apple Mail (2.619) X-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, RCVD_IN_ORBS,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_APPLEMAIL version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Nov 10, 2004, at 9:51 PM, Satoshi Hasegawa wrote: > Our program accepts input in the form of Lucene query syntax from the > user, > but we wish to perform additional tasks such as thesaurus expansion. > So I > want to manipulate the Query object that results from parsing. You may want to consider using an Analyzer to expand queries rather than manipulating the query object itself. > My question is, is the result of the Query#rewrite method guaranteed > to be > either a TermQuery, a PhraseQuery, or a BooleanQuery, and if it is a > BooleanQuery, do all the constituent clauses also reduce to one of the > above > three classes? No. For example, look at the SpanQuery family. These do no explicit rewriting and thus are left as themselves. > If not, what if the original Query object was the one that > was obtained from QueryParser#parse method? Can I assume the above in > this > restricted case? > > I experimented with the current version, and the above seems to be > positive > in this version; I'm asking if this could change in the future. Thank > you. I think we'll see QueryParser, or at least more sophisticated versions of it, emerge that support SpanQuery's. In fact, in our book, I created a subclas of QueryParser that overrides getFieldQuery and returns a SpanNearQuery in order to achieve ordered phrase searching. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org