Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 55BF8E565 for ; Thu, 28 Feb 2013 09:33:19 +0000 (UTC) Received: (qmail 17496 invoked by uid 500); 28 Feb 2013 09:33:17 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 16761 invoked by uid 500); 28 Feb 2013 09:33:16 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 16611 invoked by uid 99); 28 Feb 2013 09:33:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Feb 2013 09:33:14 +0000 Date: Thu, 28 Feb 2013 09:33:14 +0000 (UTC) From: "Alan Woodward (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SOLR-2996) make "q=*" not suck in the lucene and edismax parsers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-2996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13589375#comment-13589375 ] Alan Woodward commented on SOLR-2996: ------------------------------------- I've had a quick look, and I think it's just a matter of changing the Clause() definition in QueryParser.jj. (Warning: untested patch) {{ Index: solr/core/src/java/org/apache/solr/parser/QueryParser.jj =================================================================== --- solr/core/src/java/org/apache/solr/parser/QueryParser.jj (revision 1451143) +++ solr/core/src/java/org/apache/solr/parser/QueryParser.jj (working copy) @@ -195,7 +195,8 @@ ( - q=Term(field) + {q=handleBareTokenQuery("*", "*", fuzzySlop, prefix, true, fuzzy, regexp)} + | q=Term(field) | q=Query(field) ( boost=)? | (localParams = ( boost=)? { q=getLocalParams(field, localParams.image); } ) ) }} I don't have time to look at this properly now, but I'll probably get a chance next week. Feel free to try out that patch though! > make "q=*" not suck in the lucene and edismax parsers > ----------------------------------------------------- > > Key: SOLR-2996 > URL: https://issues.apache.org/jira/browse/SOLR-2996 > Project: Solr > Issue Type: Improvement > Components: query parsers > Reporter: Hoss Man > > More then a few users have gotten burned by thinking that "{{\*}}" is the appropriate syntax for "match all docs" when what it really does (unless i'm mistaken) is create a prefix query on the default search field using a blank string as the prefix. > since it seems very unlikely that anyone has a genuine usecase for making a prefix query with a blank prefix, we should change the default behavior of the LuceneQParser and EDismaxQParsers (and any other Qparsers that respect {{\*:\*}} if i'm forgetting them) to treat this situation the same as {{\*:\*}}. we can offer a (local)param to force the old behavior if someone really wants it. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org