You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Wojciech Biela (JIRA)" <ji...@apache.org> on 2008/09/23 12:30:44 UTC
[jira] Created: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
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: clients - java
Affects Versions: 1.3, 1.3.1, 1.4
Reporter: Wojciech Biela
Fix For: 1.3.1
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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Wojciech Biela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wojciech Biela updated SOLR-786:
--------------------------------
Attachment: dismax-query-parser.patch
corrected patch (added the ASL 2.0 Licence note)
> 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: clients - java
> Affects Versions: 1.3, 1.3.1, 1.4
> Reporter: Wojciech Biela
> Priority: Minor
> Fix For: 1.3.1
>
> Attachments: dismax-query-parser.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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Wojciech Biela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wojciech Biela updated SOLR-786:
--------------------------------
Attachment: dismax-query-parser.patch
the patch corrected, one of the methods was private, so I made it protected to allow reuse.
> 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: clients - java
> Affects Versions: 1.3, 1.3.1, 1.4
> Reporter: Wojciech Biela
> Priority: Minor
> Fix For: 1.3.1
>
> Attachments: dismax-query-parser.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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Wojciech Biela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wojciech Biela updated SOLR-786:
--------------------------------
Attachment: dismax-query-parser.patch
the patch
> 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: clients - java
> Affects Versions: 1.3, 1.3.1, 1.4
> Reporter: Wojciech Biela
> Fix For: 1.3.1
>
> Attachments: dismax-query-parser.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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Wojciech Biela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wojciech Biela updated SOLR-786:
--------------------------------
Attachment: (was: dismax-query-parser.patch)
> 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: clients - java
> Affects Versions: 1.3, 1.3.1, 1.4
> Reporter: Wojciech Biela
> Priority: Minor
> Fix For: 1.3.1
>
>
> 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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Wojciech Biela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wojciech Biela updated SOLR-786:
--------------------------------
Attachment: (was: dismax-query-parser.patch)
> 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: clients - java
> Affects Versions: 1.3, 1.3.1, 1.4
> Reporter: Wojciech Biela
> Priority: Minor
> Fix For: 1.3.1
>
> Attachments: dismax-query-parser.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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shalin Shekhar Mangar updated SOLR-786:
---------------------------------------
Component/s: (was: clients - java)
search
> 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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Wojciech Biela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wojciech Biela updated SOLR-786:
--------------------------------
Priority: Minor (was: Major)
> 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: clients - java
> Affects Versions: 1.3, 1.3.1, 1.4
> Reporter: Wojciech Biela
> Priority: Minor
> Fix For: 1.3.1
>
> Attachments: dismax-query-parser.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.
[jira] Resolved: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Koji Sekiguchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Koji Sekiguchi updated SOLR-786:
--------------------------------
Affects Version/s: (was: 1.3.1)
(was: 1.4)
Fix Version/s: (was: 1.3.1)
This is not a bug.
> 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: clients - java
> Affects Versions: 1.3
> Reporter: Wojciech Biela
> Priority: Minor
> Attachments: dismax-query-parser.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.
[jira] Updated: (SOLR-786) refactor in DisMaxQParserPlugin and
DismaxQParser to allow extending DismaxQParser
Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shalin Shekhar Mangar updated SOLR-786:
---------------------------------------
Attachment: SOLR-786.patch
Patch updated to trunk.
We've already marked DisMaxQParser as an experimental API so this can go in as well. I plan to commit shortly.
> 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: clients - java
> Affects Versions: 1.3
> Reporter: Wojciech Biela
> Priority: Minor
> 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.