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 987ADDF3E for ; Thu, 15 Nov 2012 21:41:14 +0000 (UTC) Received: (qmail 21850 invoked by uid 500); 15 Nov 2012 21:41:13 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 21673 invoked by uid 500); 15 Nov 2012 21:41:13 -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 21665 invoked by uid 99); 15 Nov 2012 21:41:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2012 21:41:13 +0000 Date: Thu, 15 Nov 2012 21:41:13 +0000 (UTC) From: "Yonik Seeley (JIRA)" To: dev@lucene.apache.org Message-ID: <1014399291.121140.1353015673314.JavaMail.jiratomcat@arcas> In-Reply-To: <1298624317.119049.1352984653066.JavaMail.jiratomcat@arcas> Subject: [jira] [Assigned] (SOLR-4081) QueryParsing.toString(Query,IndexSchema) does not properly handle WrappedQuery 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-4081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yonik Seeley reassigned SOLR-4081: ---------------------------------- Assignee: Yonik Seeley > QueryParsing.toString(Query,IndexSchema) does not properly handle WrappedQuery > ------------------------------------------------------------------------------ > > Key: SOLR-4081 > URL: https://issues.apache.org/jira/browse/SOLR-4081 > Project: Solr > Issue Type: Bug > Components: query parsers > Affects Versions: 4.0 > Reporter: Eirik Lygre > Assignee: Yonik Seeley > Priority: Minor > > QueryParsing.toString() is a method that uses knowledge of various Query implementations to properly render a query string. For example, using toString with a BooleanQuery might return a string like this: > {{owner_id:18935 (acl_id:9451 acl_id:11634 acl_id:15678 acl_id:16791)}} > When using localParams such as "{!cache=false cost=0}", the query turns into a WrappedQuery wrapping a BooleanQuery. This is not understood by QueryParsing.toString(), which calls WrappedQuery.toString() instead, returning a string like this: > {{\{!cache=false cost=0}owner_id:w (acl_id:` acl_id:Ik acl_id:Zr acl_id:z> acl_id:\)}} > The probable (untested) solution will be to include a couple of lines at the top of toString(), as shown below. A further optimization would be to create "void WrappedQuery.getOptions(Appendable out)", to avoid creating a StringBuilder inside WrappedQuery.getOptions(). > {code} > public static void toString(Query query, IndexSchema schema, Appendable out, int flags) throws IOException { > boolean writeBoost = true; > // Begin new code to handle WrappedQuery > if (query instanceof WrappedQuery) { > WrappedQuery q = (WrappedQuery)query; > out.append (q.getOptions()); > query = q.getWrappedQuery(); > } > // End new code to handle WrappedQuery > if (query instanceof TermQuery) { > ... > {code} -- 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