Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 6196 invoked from network); 8 Feb 2007 18:32:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2007 18:32:56 -0000 Received: (qmail 11918 invoked by uid 500); 8 Feb 2007 18:32:55 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 11893 invoked by uid 500); 8 Feb 2007 18:32:55 -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 11882 invoked by uid 99); 8 Feb 2007 18:32:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 10:32:55 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [130.238.4.154] (HELO colibri.its.uu.se) (130.238.4.154) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 10:32:45 -0800 Received: by colibri.its.uu.se (Postfix, from userid 211) id 4841E902; Thu, 8 Feb 2007 19:32:22 +0100 (NFT) Received: from colibri.its.uu.se(127.0.0.1) by colibri.its.uu.se via virus-scan id s14356; Thu, 8 Feb 07 19:32:13 +0100 Received: from ninox.its.uu.se (ninox.its.uu.se [130.238.4.197]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by colibri.its.uu.se (Postfix) with ESMTP id 352CBA1D for ; Thu, 8 Feb 2007 19:32:13 +0100 (NFT) Received: from localhost ([127.0.0.1] helo=jubula) by ninox.its.uu.se with esmtp (Exim 4.63) (envelope-from ) id 1HFE44-0002tk-W2 for java-user@lucene.apache.org; Thu, 08 Feb 2007 19:32:13 +0100 Received: from c-234de253.16-1-64736c11.cust.bredbandsbolaget.se (c-234de253.16-1-64736c11.cust.bredbandsbolaget.se [83.226.77.35]) by webmail3.uu.se (Horde MIME library) with HTTP; Thu, 08 Feb 2007 19:32:12 +0100 Message-ID: <20070208193212.agmp9morw8ws04os@webmail3.uu.se> Date: Thu, 08 Feb 2007 19:32:12 +0100 From: Ronnie Kolehmainen To: java-user@lucene.apache.org Subject: Re: Empty search References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) X-Virus-Checked: Checked by ClamAV on apache.org If you are refering to QueryParser, and if you mean that you want =20 Lucene to *find everything* when you actually say *search for =20 nothing*, you could easily extend current Queryparser to suit your =20 needs: public class MyQueryParser extends QueryParser { public MyQueryParser(String f, Analyzer a) { super(f, a); } public Query parse(String query) throws ParseException { if (null =3D=3D query || query.trim().length() =3D=3D 0) { return new MatchAllDocsQuery(); } return super.parse(query); } } Regards, Ronnie Quoting "Kainth, Sachin" : > Is it my imagination or does lucene produce an error if you present it > with an empty string to search for? > > > This email and any attached files are confidential and copyright =20 > protected. If you are not the addressee, any dissemination of this =20 > communication is strictly prohibited. Unless otherwise expressly =20 > agreed in writing, nothing stated in this communication shall be =20 > legally binding. > > The ultimate parent company of the Atkins Group is WS Atkins plc. =20 > Registered in England No. 1885586. Registered Office Woodcote =20 > Grove, Ashley Road, Epsom, Surrey KT18 5BW. > > Consider the environment. Please don't print this e-mail unless you =20 > really need to. > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org