Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@minotaur.apache.org Received: (qmail 56199 invoked from network); 28 May 2009 08:02:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 May 2009 08:02:56 -0000 Received: (qmail 67783 invoked by uid 500); 28 May 2009 08:03:07 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 67691 invoked by uid 500); 28 May 2009 08:03:07 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 67681 invoked by uid 99); 28 May 2009 08:03:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 08:03:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 08:03:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AD587234C056 for ; Thu, 28 May 2009 01:02:45 -0700 (PDT) Message-ID: <47680155.1243497765709.JavaMail.jira@brutus> Date: Thu, 28 May 2009 01:02:45 -0700 (PDT) From: "Shalin Shekhar Mangar (JIRA)" To: solr-dev@lucene.apache.org Subject: [jira] Resolved: (SOLR-786) refactor in DisMaxQParserPlugin and DismaxQParser to allow extending DismaxQParser In-Reply-To: <1435569532.1222165844162.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shalin Shekhar Mangar resolved SOLR-786. ---------------------------------------- Resolution: Fixed Fix Version/s: 1.4 Assignee: Shalin Shekhar Mangar Committed revision 779469. Thanks Wojciech! > refactor in DisMaxQParserPlugin and DismaxQParser to allow extending DismaxQParser > ---------------------------------------------------------------------------------- > > Key: SOLR-786 > URL: https://issues.apache.org/jira/browse/SOLR-786 > Project: Solr > Issue Type: Improvement > Components: search > Affects Versions: 1.3 > Reporter: Wojciech Biela > Assignee: Shalin Shekhar Mangar > Priority: Minor > Fix For: 1.4 > > Attachments: dismax-query-parser.patch, SOLR-786.patch > > > I needed to change some of the default behaviour of the DismaxQParser, so as opposed to infecting the solr codebase with our custom behaviour, I wanted to be able to subclass the DismaxQParser and change only what we wanted to change. > Here I submit a patch that allows for such subclassing. The change that is done to the code base in the following steps: > 1. refactor in the DismaxQParser.parse() method to > addMainQuery(query, solrParams); > addBoostQuery(query, solrParams); > addBoostFunctions(query, solrParams); > 2. refactor the addMainQuery() method to use > getUserQuery(userQuery, up, solrParams) > getAlternateUserQuery(solrParams) > getPhraseQuery(userQuery, pp) > 3. move the DismaxQParser to the top-level to make it public (and allow subclassing) > After applying this change I can to as follows: > 1. write my own QParserPlugin to return a subclass of the DismaxQParser > 2. in this subclass I override the the methods I need, in my case the getUserQuery() method. > 3. add this plugin to the solrconfig.xml and use it > the patch is done against the Solr svn trunk -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.