Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 57170 invoked from network); 26 Sep 2007 09:22:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Sep 2007 09:22:30 -0000 Received: (qmail 4686 invoked by uid 500); 26 Sep 2007 09:22:15 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 4657 invoked by uid 500); 26 Sep 2007 09:22:15 -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 4646 invoked by uid 99); 26 Sep 2007 09:22:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Sep 2007 02:22:14 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.12.10.87] (HELO web26013.mail.ukl.yahoo.com) (217.12.10.87) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 26 Sep 2007 09:24:32 +0000 Received: (qmail 48508 invoked by uid 60001); 26 Sep 2007 09:21:53 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=hQbOJy37W/I3wz9kIO+iB8aTHDPNPbyaL2PeZ+WgBAj25AV5UMMeQ1OmJJmJkstdcEKFdo4sjpcg23P294bfrUckBr7EJR5fZSo6NIVwyHfhCrZx51Zlb+64QxMwo53xfehJ0+VXWD6u0QTtejCWQhisnkJWkFeDcBHroymjtvA=; X-YMail-OSG: e.d0T4wVM1ntO2xXcp3VKmymW4ACQdbtVJnOks5a4IKvhrbKE2l2eSGpOH2zQyi2O7PmLIpQJreUiGfkK43Xh1NMHvwdaDQPE6EUq.MXyJbiZct91B0AEfdarho- Received: from [193.36.230.96] by web26013.mail.ukl.yahoo.com via HTTP; Wed, 26 Sep 2007 09:21:53 GMT X-Mailer: YahooMailRC/651.50 YahooMailWebService/0.7.134 Date: Wed, 26 Sep 2007 09:21:53 +0000 (GMT) From: mark harwood Subject: Re: Wildcard vs Term query To: java-user@lucene.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <870466.47683.qm@web26013.mail.ukl.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Are you using the out of the box Lucene QueryParser? It will automatically= detect wildcard queries by the presence of * or ? chars.=0AIf the user inp= ut does not contain these characters a plain TermQuery is used.=0A=0ABoolea= nQuery.setMaxClauseCount can be used to control the upper limit on terms pr= oduced by Wildcard/Fuzzy Queries.=0AIf this limit is exceeded (e.g when sea= rching for something like "a*" ) then an exception is thrown.=0A=0ACheers= =0AMark=0A----- Original Message ----=0AFrom: John Byrne =0ATo: java-user@lucene.apache.org=0ASent: Wednesday, 26 September, = 2007 9:48:17 AM=0ASubject: Wildcard vs Term query=0A=0AHi,=0A=0AI'm working= my way through the Lucene In Action book, and there is one =0Athing I need= explained that I didn't find there;=0A=0AWhile wildcard queries are potent= ially slower than ordinary term =0Aqueries, are they slower even if theyt d= on't contain a wildcard? =0ASignificantly slower?=0A=0AThe reason I ask is = that if we assume we are going to allow wildcards in =0Aa search engine, bu= t we want to optimize, to take advantage of when =0Athey are NOT used, do = we have to check for the presence of "*" or "?" in =0Athe term, and create = the most appropriate query, or can I assume that =0Awhen a wildcard is not = present, the WildcardQuery will be as fast (or =0Aalmost as fast) a a plain= term query?=0A=0AThanks in advance!=0AJohn B.=0A=0A-----------------------= ----------------------------------------------=0ATo unsubscribe, e-mail: ja= va-user-unsubscribe@lucene.apache.org=0AFor additional commands, e-mail: ja= va-user-help@lucene.apache.org=0A=0A=0A=0A=0A=0A=0A __________________= _________________________________________=0AYahoo! Answers - Got a question= ? Someone out there knows the answer. Try it=0Anow.=0Ahttp://uk.answers.yah= oo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org