Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 2628 invoked from network); 9 Mar 2005 12:38:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Mar 2005 12:38:08 -0000 Received: (qmail 19391 invoked by uid 500); 9 Mar 2005 12:38:04 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 19252 invoked by uid 500); 9 Mar 2005 12:38:04 -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 19234 invoked by uid 99); 9 Mar 2005 12:38:04 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from proserver2.ifit.uni-klu.ac.at (HELO proserver2.ifit.uni-klu.ac.at) (143.205.118.212) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 09 Mar 2005 04:38:03 -0800 Received: from [143.205.118.98] ([143.205.118.98]) by proserver2.ifit.uni-klu.ac.at over TLS secured channel with Microsoft SMTPSVC(5.0.2195.6713); Wed, 9 Mar 2005 13:38:01 +0100 Message-ID: <422EEE28.2020509@ifit.uni-klu.ac.at> Date: Wed, 09 Mar 2005 13:38:00 +0100 From: sergiu gordea User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: en-us, en MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: QueryParser refactoring References: <16940.47718.444427.724315@onlinehome.de> <9ee8730d005921ac5d712bef8d2af0b1@ehatchersolutions.com> <16941.21568.532376.650196@tanto-xipolis.de> <76660b51560499b1f343a32fd7d99adc@ehatchersolutions.com> <16941.29325.935944.415129@tanto-xipolis.de> <6a2448ceb8e385ad4505470dd6037290@ehatchersolutions.com> <16941.45901.672724.728010@tanto-xipolis.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Mar 2005 12:38:01.0060 (UTC) FILETIME=[D4A2C240:01C524A4] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Chris Hostetter wrote: >Earlier in this thread... > >: >>> +a -> a >: >> >: >> Hmmm.... this is a debatable one. It's returning a TermQuery in this >: >> case for "a". Is that appropriate? Or should it return a >: >> BooleanQuery >: >> with a single TermQuery as required? > >: > Ok. >: > The question how to handle BooleanQueries, that contain prohibited >: > terms >: > only, is a question on it's own. >: > In my fix I choose to silently drop these queries. Basically because >: > it's >: > effectivly dropped during querying anyway. > >...I would argue that the most correct behavior would be for QP to >generate a Boolean query indicating the required/expluded term -- even if >a Searcher can't run that query as is. It's not the QueryParsers job to >know what Query object structures make sense or not, just to know what the >sanest possible maping from text to query object tree is. > >i can think of some very valid use cases where a client would build a >complex Query out of some progromaticly generated Query objects, and the >Query returned by the QP -- those clients aren't going to be happy if QP >is returning an exception because the Query it's generating doesn't look >"valid" > > I makes sense, but I think that invalid queries should trow an exception, at least at search time. >: That's ok then. Throw a ParseException and whoever doesn't like that, >: can overwrite the method and either keep the query (knowing that it will >: be ignored in search anyway) or drop it. > >if that's the route people want to go, then i'd like to instead advocate >that the default behavior for this situation be no error. > > silently drop clauses I consider to be the worst solution ... because the user will be confused... it will be hard to discover why the search is not working how it espects to. An alternative will be to use Log4J to log these warnings.... > > >-Hoss > > >--------------------------------------------------------------------- >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