[jira] [Updated] (SOLR-5831) Scale score PostFilter
[ https://issues.apache.org/jira/browse/SOLR-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Keegan updated SOLR-5831: --- Attachment: scalescoreplugin.zip I reimplemented this PostFilter as a RankQuery in 4.9. Although it still has some of the complexity of the PostFilter, it no longer has to manage its own PQ and since it's a plugin, there are no changes to Solr core. I haven't figured out how to implement the 'explain' method yet, since most of the state is in the collector. Also, where does one contribute external plugins? Peter Scale score PostFilter -- Key: SOLR-5831 URL: https://issues.apache.org/jira/browse/SOLR-5831 Project: Solr Issue Type: Improvement Components: search Affects Versions: 4.7 Reporter: Peter Keegan Assignee: Joel Bernstein Priority: Minor Fix For: 4.9 Attachments: SOLR-5831.patch, SOLR-5831.patch, SOLR-5831.patch, SOLR-5831.patch, SOLR-5831.patch, TestScaleScoreQParserPlugin.patch, scalescoreplugin.zip The ScaleScoreQParserPlugin is a PostFilter that performs score scaling. This is an alternative to using a function query wrapping a scale() wrapping a query(). For example: select?qq={!edismax v='news' qf='title^2 body'}scaledQ=scale(product(query($qq),1),0,1)q={!func}sum(product(0.75,$scaledQ),product(0.25,field(myfield)))fq={!query v=$qq} The problem with this query is that it has to scale every hit. Usually, only the returned hits need to be scaled, but there may be use cases where the number of hits to be scaled is greater than the returned hit count, but less than or equal to the total hit count. Sample syntax: fq={!scalescore+l=0.0 u=1.0 maxscalehits=1 func=sum(product(sscore(),0.75),product(field(myfield),0.25))} l=0.0 u=1.0 //Scale scores to values between 0-1, inclusive maxscalehits=1//The maximum number of result scores to scale (-1 = all hits, 0 = results 'page' size) func=... //Apply the composite function to each hit. The scaled score value is accessed by the 'score()' value source All parameters are optional. The defaults are: l=0.0 u=1.0 maxscalehits=0 (result window size) func=(null) Note: this patch is not complete, as it contains no test cases and may not conform to all the guidelines in http://wiki.apache.org/solr/HowToContribute. I would appreciate any feedback on the usability and implementation. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (SOLR-5831) Scale score PostFilter
[ https://issues.apache.org/jira/browse/SOLR-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Keegan updated SOLR-5831: --- Attachment: SOLR-5831.patch Hi Joel, The bug I discovered with secondary sort only occurs when the index has multiple segments. The dummy scorer docId should have been relative to the doc base. Also, the collector 'finish' method wasn't calling the delegate's finish method. Both of these bugs were fixed in the previous patch. I don't have a unit test for multiple segments, but I did add a new unit test for the 'maxscalehits' parameter. I'm still not sure that I'm determining the result window size for the QueryResultCache, correctly. See this part: // Determine the results window size. // TODO: this should be sized larger for the query result cache int winSize = request.getSearcher().getCore().getSolrConfig().queryResultWindowSize; Could you verify if this is ok? Thanks, Peter Scale score PostFilter -- Key: SOLR-5831 URL: https://issues.apache.org/jira/browse/SOLR-5831 Project: Solr Issue Type: Improvement Components: search Affects Versions: 4.7 Reporter: Peter Keegan Assignee: Joel Bernstein Priority: Minor Fix For: 4.9 Attachments: SOLR-5831.patch, SOLR-5831.patch, SOLR-5831.patch, SOLR-5831.patch, TestScaleScoreQParserPlugin.patch The ScaleScoreQParserPlugin is a PostFilter that performs score scaling. This is an alternative to using a function query wrapping a scale() wrapping a query(). For example: select?qq={!edismax v='news' qf='title^2 body'}scaledQ=scale(product(query($qq),1),0,1)q={!func}sum(product(0.75,$scaledQ),product(0.25,field(myfield)))fq={!query v=$qq} The problem with this query is that it has to scale every hit. Usually, only the returned hits need to be scaled, but there may be use cases where the number of hits to be scaled is greater than the returned hit count, but less than or equal to the total hit count. Sample syntax: fq={!scalescore+l=0.0 u=1.0 maxscalehits=1 func=sum(product(sscore(),0.75),product(field(myfield),0.25))} l=0.0 u=1.0 //Scale scores to values between 0-1, inclusive maxscalehits=1//The maximum number of result scores to scale (-1 = all hits, 0 = results 'page' size) func=... //Apply the composite function to each hit. The scaled score value is accessed by the 'score()' value source All parameters are optional. The defaults are: l=0.0 u=1.0 maxscalehits=0 (result window size) func=(null) Note: this patch is not complete, as it contains no test cases and may not conform to all the guidelines in http://wiki.apache.org/solr/HowToContribute. I would appreciate any feedback on the usability and implementation. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (SOLR-5831) Scale score PostFilter
[ https://issues.apache.org/jira/browse/SOLR-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joel Bernstein updated SOLR-5831: - Fix Version/s: 4.9 Scale score PostFilter -- Key: SOLR-5831 URL: https://issues.apache.org/jira/browse/SOLR-5831 Project: Solr Issue Type: Improvement Components: search Affects Versions: 4.7 Reporter: Peter Keegan Assignee: Joel Bernstein Priority: Minor Fix For: 4.9 Attachments: SOLR-5831.patch, SOLR-5831.patch, SOLR-5831.patch, TestScaleScoreQParserPlugin.patch The ScaleScoreQParserPlugin is a PostFilter that performs score scaling. This is an alternative to using a function query wrapping a scale() wrapping a query(). For example: select?qq={!edismax v='news' qf='title^2 body'}scaledQ=scale(product(query($qq),1),0,1)q={!func}sum(product(0.75,$scaledQ),product(0.25,field(myfield)))fq={!query v=$qq} The problem with this query is that it has to scale every hit. Usually, only the returned hits need to be scaled, but there may be use cases where the number of hits to be scaled is greater than the returned hit count, but less than or equal to the total hit count. Sample syntax: fq={!scalescore+l=0.0 u=1.0 maxscalehits=1 func=sum(product(sscore(),0.75),product(field(myfield),0.25))} l=0.0 u=1.0 //Scale scores to values between 0-1, inclusive maxscalehits=1//The maximum number of result scores to scale (-1 = all hits, 0 = results 'page' size) func=... //Apply the composite function to each hit. The scaled score value is accessed by the 'score()' value source All parameters are optional. The defaults are: l=0.0 u=1.0 maxscalehits=0 (result window size) func=(null) Note: this patch is not complete, as it contains no test cases and may not conform to all the guidelines in http://wiki.apache.org/solr/HowToContribute. I would appreciate any feedback on the usability and implementation. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (SOLR-5831) Scale score PostFilter
[ https://issues.apache.org/jira/browse/SOLR-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Keegan updated SOLR-5831: --- Attachment: SOLR-5831.patch Thanks Joel. I found a bug in the Collector's 'finish()' method that wasn't obvious until I added a secondary Sort to a query. Patch updated. Scale score PostFilter -- Key: SOLR-5831 URL: https://issues.apache.org/jira/browse/SOLR-5831 Project: Solr Issue Type: Improvement Components: search Affects Versions: 4.7 Reporter: Peter Keegan Assignee: Joel Bernstein Priority: Minor Attachments: SOLR-5831.patch, SOLR-5831.patch, SOLR-5831.patch, TestScaleScoreQParserPlugin.patch The ScaleScoreQParserPlugin is a PostFilter that performs score scaling. This is an alternative to using a function query wrapping a scale() wrapping a query(). For example: select?qq={!edismax v='news' qf='title^2 body'}scaledQ=scale(product(query($qq),1),0,1)q={!func}sum(product(0.75,$scaledQ),product(0.25,field(myfield)))fq={!query v=$qq} The problem with this query is that it has to scale every hit. Usually, only the returned hits need to be scaled, but there may be use cases where the number of hits to be scaled is greater than the returned hit count, but less than or equal to the total hit count. Sample syntax: fq={!scalescore+l=0.0 u=1.0 maxscalehits=1 func=sum(product(sscore(),0.75),product(field(myfield),0.25))} l=0.0 u=1.0 //Scale scores to values between 0-1, inclusive maxscalehits=1//The maximum number of result scores to scale (-1 = all hits, 0 = results 'page' size) func=... //Apply the composite function to each hit. The scaled score value is accessed by the 'score()' value source All parameters are optional. The defaults are: l=0.0 u=1.0 maxscalehits=0 (result window size) func=(null) Note: this patch is not complete, as it contains no test cases and may not conform to all the guidelines in http://wiki.apache.org/solr/HowToContribute. I would appreciate any feedback on the usability and implementation. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (SOLR-5831) Scale score PostFilter
[ https://issues.apache.org/jira/browse/SOLR-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Keegan updated SOLR-5831: --- Attachment: TestScaleScoreQParserPlugin.patch Scale score PostFilter -- Key: SOLR-5831 URL: https://issues.apache.org/jira/browse/SOLR-5831 Project: Solr Issue Type: Improvement Components: search Affects Versions: 4.7 Reporter: Peter Keegan Assignee: Joel Bernstein Priority: Minor Attachments: SOLR-5831.patch, SOLR-5831.patch, TestScaleScoreQParserPlugin.patch The ScaleScoreQParserPlugin is a PostFilter that performs score scaling. This is an alternative to using a function query wrapping a scale() wrapping a query(). For example: select?qq={!edismax v='news' qf='title^2 body'}scaledQ=scale(product(query($qq),1),0,1)q={!func}sum(product(0.75,$scaledQ),product(0.25,field(myfield)))fq={!query v=$qq} The problem with this query is that it has to scale every hit. Usually, only the returned hits need to be scaled, but there may be use cases where the number of hits to be scaled is greater than the returned hit count, but less than or equal to the total hit count. Sample syntax: fq={!scalescore+l=0.0 u=1.0 maxscalehits=1 func=sum(product(sscore(),0.75),product(field(myfield),0.25))} l=0.0 u=1.0 //Scale scores to values between 0-1, inclusive maxscalehits=1//The maximum number of result scores to scale (-1 = all hits, 0 = results 'page' size) func=... //Apply the composite function to each hit. The scaled score value is accessed by the 'score()' value source All parameters are optional. The defaults are: l=0.0 u=1.0 maxscalehits=0 (result window size) func=(null) Note: this patch is not complete, as it contains no test cases and may not conform to all the guidelines in http://wiki.apache.org/solr/HowToContribute. I would appreciate any feedback on the usability and implementation. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (SOLR-5831) Scale score PostFilter
[ https://issues.apache.org/jira/browse/SOLR-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Keegan updated SOLR-5831: --- Attachment: SOLR-5831.patch Scale score PostFilter -- Key: SOLR-5831 URL: https://issues.apache.org/jira/browse/SOLR-5831 Project: Solr Issue Type: Improvement Components: search Affects Versions: 4.7 Reporter: Peter Keegan Assignee: Joel Bernstein Priority: Minor Attachments: SOLR-5831.patch, SOLR-5831.patch The ScaleScoreQParserPlugin is a PostFilter that performs score scaling. This is an alternative to using a function query wrapping a scale() wrapping a query(). For example: select?qq={!edismax v='news' qf='title^2 body'}scaledQ=scale(product(query($qq),1),0,1)q={!func}sum(product(0.75,$scaledQ),product(0.25,field(myfield)))fq={!query v=$qq} The problem with this query is that it has to scale every hit. Usually, only the returned hits need to be scaled, but there may be use cases where the number of hits to be scaled is greater than the returned hit count, but less than or equal to the total hit count. Sample syntax: fq={!scalescore+l=0.0 u=1.0 maxscalehits=1 func=sum(product(sscore(),0.75),product(field(myfield),0.25))} l=0.0 u=1.0 //Scale scores to values between 0-1, inclusive maxscalehits=1//The maximum number of result scores to scale (-1 = all hits, 0 = results 'page' size) func=... //Apply the composite function to each hit. The scaled score value is accessed by the 'score()' value source All parameters are optional. The defaults are: l=0.0 u=1.0 maxscalehits=0 (result window size) func=(null) Note: this patch is not complete, as it contains no test cases and may not conform to all the guidelines in http://wiki.apache.org/solr/HowToContribute. I would appreciate any feedback on the usability and implementation. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (SOLR-5831) Scale score PostFilter
[ https://issues.apache.org/jira/browse/SOLR-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Keegan updated SOLR-5831: --- Attachment: SOLR-5831.patch Scale score PostFilter -- Key: SOLR-5831 URL: https://issues.apache.org/jira/browse/SOLR-5831 Project: Solr Issue Type: Improvement Components: search Affects Versions: 4.7 Reporter: Peter Keegan Priority: Minor Attachments: SOLR-5831.patch The ScaleScoreQParserPlugin is a PostFilter that performs score scaling. This is an alternative to using a function query wrapping a scale() wrapping a query(). For example: select?qq={!edismax v='news' qf='title^2 body'}scaledQ=scale(product(query($qq),1),0,1)q={!func}sum(product(0.75,$scaledQ),product(0.25,field(myfield)))fq={!query v=$qq} The problem with this query is that it has to scale every hit. Usually, only the returned hits need to be scaled, but there may be use cases where the number of hits to be scaled is greater than the returned hit count, but less than or equal to the total hit count. Sample syntax: fq={!scalescore+l=0.0 u=1.0 maxscalehits=1 func=sum(product(sscore(),0.75),product(field(myfield),0.25))} l=0.0 u=1.0 //Scale scores to values between 0-1, inclusive maxscalehits=1//The maximum number of result scores to scale (-1 = all hits, 0 = results 'page' size) func=... //Apply the composite function to each hit. The scaled score value is accessed by the 'score()' value source All parameters are optional. The defaults are: l=0.0 u=1.0 maxscalehits=0 (result window size) func=(null) Note: this patch is not complete, as it contains no test cases and may not conform to all the guidelines in http://wiki.apache.org/solr/HowToContribute. I would appreciate any feedback on the usability and implementation. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org