From java-dev-return-13320-apmail-lucene-java-dev-archive=lucene.apache.org@lucene.apache.org Thu Apr 06 17:19:58 2006 Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 45117 invoked from network); 6 Apr 2006 17:19:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2006 17:19:57 -0000 Received: (qmail 45615 invoked by uid 500); 6 Apr 2006 17:19:55 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 45583 invoked by uid 500); 6 Apr 2006 17:19:55 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 45570 invoked by uid 99); 6 Apr 2006 17:19:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 10:19:54 -0700 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 [194.109.24.37] (HELO smtp-vbr17.xs4all.nl) (194.109.24.37) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 10:19:54 -0700 Received: from k8l.lan (porta.xs4all.nl [80.127.24.69]) by smtp-vbr17.xs4all.nl (8.13.6/8.13.6) with ESMTP id k36HJWwY061444 for ; Thu, 6 Apr 2006 19:19:33 +0200 (CEST) (envelope-from paul.elschot@xs4all.nl) From: Paul Elschot To: java-dev@lucene.apache.org Subject: Re: Query.extractTerms - a poor introspection API? Date: Thu, 6 Apr 2006 19:19:31 +0200 User-Agent: KMail/1.8.2 References: <20060406095213.13703.qmail@web26009.mail.ukl.yahoo.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604061919.32171.paul.elschot@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Thursday 06 April 2006 18:53, Yonik Seeley wrote: > On 4/6/06, mark harwood wrote: > > Maybe we should have as a standard part of Query: > > > > //immediate child queries only > > Query [] getNestedQueries(); This is another way to deal with composed queries: http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/ComposedQuery.java?rev=209183&view=log In surround, this is the superclass for all queries that have an operator and subqueries. > > It's still the case that you often need to know what type of query the > parent is. > For example, a BooleanQuery with mandatory, optional, and prohibited clauses. > Or, as Marvin brings up, phrase queries, etc. > > One may not want to worry about terms that don't match when constrants > are applied (like a phrase) to begin with, but you don't want to > implement it in such a way that makes it hard to add later. > > IMO, the query hierarchy should be fully self-describable... user code > should be able to walk it and re-create the exact same thing if > desired. There is a visitMatchingTerms method here: http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SimpleTerm.java?rev=209183&view=log This is the superclass for the term queries such as truncated terms. Regards, Paul Elschot --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org