[jira] [Comment Edited] (SOLR-1485) Payload scoring support

2017-04-21 Thread Erik Hatcher (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15977930#comment-15977930
 ] 

Erik Hatcher edited comment on SOLR-1485 at 4/21/17 12:21 PM:
--

It's interesting to note that there is actually one query built in that could 
handle payload scoring already: {{q=\{!xmlparser}weighted}}, with hardcoded 
"average" function and includeSpanScore=true, resulting in the above data 
example an output of:
{code}
id,score
2,71.00154
{code}

And here's a patch that adds includeSpanScore control flexibility to 
{{}}:

{code}
--- 
a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingTermBuilder.java
+++ 
b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingTermBuilder.java
@@ -34,11 +34,12 @@ public class BoostingTermBuilder extends SpanBuilderBase {
   @Override
   public SpanQuery getSpanQuery(Element e) throws ParserException {
 String fieldName = DOMUtils.getAttributeWithInheritanceOrFail(e, 
"fieldName");
+boolean includeSpanQuery = DOMUtils.getAttribute(e, "includeSpanScore", 
true);
 String value = DOMUtils.getNonBlankTextOrFail(e);
 
-// TODO: add parameter to control PayloadScoreQuery's `includeSpanScore` 
and `PayloadFunction`
+// TODO: add parameter to control PayloadScoreQuery's and `PayloadFunction`
 SpanQuery btq = new PayloadScoreQuery(new SpanTermQuery(new 
Term(fieldName, value)),
-new AveragePayloadFunction());
+new AveragePayloadFunction(), includeSpanQuery);
 btq = new SpanBoostQuery(btq, DOMUtils.getAttribute(e, "boost", 1.0f));
 return btq;
   }
{code}



was (Author: ehatcher):
It's interesting to note that there is actually one query built in that could 
handle payload scoring already: {{q=\{!xmlparser}weighted}}, with hardcoded 
"average" function and includeSpanScore=true, resulting in the above data 
example an output of:
{code}
id,score
2,71.00154
{code}

> Payload scoring support
> ---
>
> Key: SOLR-1485
> URL: https://issues.apache.org/jira/browse/SOLR-1485
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Reporter: Erik Hatcher
>Assignee: Erik Hatcher
>Priority: Minor
> Fix For: master (7.0)
>
> Attachments: PayloadTermQueryPlugin.java, payload_value_source.png, 
> SOLR-1485.patch, SOLR-1485.patch, SOLR-1485.patch, SOLR-1485.patch, 
> SOLR-1485.patch
>
>
> Solr has no support for Lucene's PayloadScoreQuery, yet it has support for 
> indexing payloads (via DelimitedPayloadTokenFilter or 
> NumericPayloadTokenFilter). 
> This issue adds value source and query parser support for leveraging payloads 
> created by those token filters.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Comment Edited] (SOLR-1485) Payload scoring support

2017-04-21 Thread Erik Hatcher (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15977923#comment-15977923
 ] 

Erik Hatcher edited comment on SOLR-1485 at 4/21/17 12:07 PM:
--

With the latest patch, one can index payloaded terms like this:

{code}
bin/solr create -c payloads
bin/post -c payloads -type text/csv -out yes -d 
$'id,weighted_terms_dpf\n1,one|1.0 two|2.0 three|3.0\n2,weighted|50.0 
weighted|100.0'

# this is two documents:
# 1: one|1.0 two|2.0 three|3.0
# 2: weighted|50.0 weighted|100.0
{code}

and then get the values back as scores like this:

{code}
http://localhost:8983/solr/payloads/select?q={!payload_score 
f=weighted_terms_dpf v=$payload_term 
func=max}=id,*_dpf,score=csv_term=two
* _term=two
id,score
1,2.0

* _term=three:
id,score
1,3.0

* _term=weighted (func=max):
id,score
2,100.0

* _term=weighted (func=min):
id,score
2,50.0

* _term=weighted (func=average):
id,score
2,75.0
{code}


was (Author: ehatcher):
With the latest patch, one can index payloaded terms like this:

{code}
bin/solr create -c payloads
bin/post -c payloads -type text/csv -out yes -d 
$'id,weighted_terms_dpf\n1,one|1.0 two|2.0 three|3.0\n2,weighted|50.0 
weighted|100.0'
{code}

and then get the values back as scores like this:

{code}
http://localhost:8983/solr/payloads/select?q={!payload_score 
f=weighted_terms_dpf v=$payload_term 
func=max}=id,*_dpf,score=csv_term=two
* _term=two
id,score
1,2.0

* _term=three:
id,score
1,3.0

* _term=weighted (func=max):
id,score
2,100.0

* _term=weighted (func=min):
id,score
2,50.0

* _term=weighted (func=average):
id,score
2,75.0
{code}

> Payload scoring support
> ---
>
> Key: SOLR-1485
> URL: https://issues.apache.org/jira/browse/SOLR-1485
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Reporter: Erik Hatcher
>Assignee: Erik Hatcher
>Priority: Minor
> Fix For: master (7.0)
>
> Attachments: PayloadTermQueryPlugin.java, payload_value_source.png, 
> SOLR-1485.patch, SOLR-1485.patch, SOLR-1485.patch, SOLR-1485.patch, 
> SOLR-1485.patch
>
>
> Solr has no support for Lucene's PayloadScoreQuery, yet it has support for 
> indexing payloads (via DelimitedPayloadTokenFilter or 
> NumericPayloadTokenFilter). 
> This issue adds value source and query parser support for leveraging payloads 
> created by those token filters.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Comment Edited] (SOLR-1485) Payload scoring support

2017-04-20 Thread Erik Hatcher (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15977930#comment-15977930
 ] 

Erik Hatcher edited comment on SOLR-1485 at 4/21/17 1:50 AM:
-

It's interesting to note that there is actually one query built in that could 
handle payload scoring already: {{q=\{!xmlparser}weighted}}, with hardcoded 
"average" function and includeSpanScore=true, resulting in the above data 
example an output of:
{code}
id,score
2,71.00154
{code}


was (Author: ehatcher):
It's interested to note that there is actually one query built in that could 
handle payload scoring already: {{q=\{!xmlparser}weighted}}, with hardcoded 
"average" function and includeSpanScore=true, resulting in the above data 
example an output of:
{code}
id,score
2,71.00154
{code}

> Payload scoring support
> ---
>
> Key: SOLR-1485
> URL: https://issues.apache.org/jira/browse/SOLR-1485
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Reporter: Erik Hatcher
>Assignee: Erik Hatcher
>Priority: Minor
> Fix For: master (7.0)
>
> Attachments: PayloadTermQueryPlugin.java, payload_value_source.png, 
> SOLR-1485.patch, SOLR-1485.patch, SOLR-1485.patch, SOLR-1485.patch, 
> SOLR-1485.patch
>
>
> Solr has no support for Lucene's PayloadScoreQuery, yet it has support for 
> indexing payloads (via DelimitedPayloadTokenFilter or 
> NumericPayloadTokenFilter). 
> This issue adds value source and query parser support for leveraging payloads 
> created by those token filters.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Comment Edited] (SOLR-1485) Payload scoring support

2017-04-19 Thread Erik Hatcher (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15973885#comment-15973885
 ] 

Erik Hatcher edited comment on SOLR-1485 at 4/19/17 3:29 PM:
-

While I'm at it, I found that Lucene's {{PayloadScoreQuery}} had a 
.equals/hashCode/cache bug in that it didn't take into account the 
{{includeSpanScore}} flag - fixed here.


was (Author: ehatcher):
While I'm at it, I found that Lucene's {{PayloadScoreQuery}} had a 
.equals/hashCode/cache bug in that it didn't into account the includeSpanScore 
flag - fixed here.

> Payload scoring support
> ---
>
> Key: SOLR-1485
> URL: https://issues.apache.org/jira/browse/SOLR-1485
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Reporter: Erik Hatcher
>Assignee: Erik Hatcher
>Priority: Minor
> Fix For: master (7.0)
>
> Attachments: PayloadTermQueryPlugin.java, payload_value_source.png, 
> SOLR-1485.patch, SOLR-1485.patch, SOLR-1485.patch, SOLR-1485.patch
>
>
> Solr has no support for Lucene's PayloadScoreQuery, yet it has support for 
> indexing payloads (via DelimitedPayloadTokenFilter or 
> NumericPayloadTokenFilter). 
> This issue adds value source and query parser support for leveraging payloads 
> created by those token filters.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Comment Edited] (SOLR-1485) Payload scoring support

2017-04-18 Thread Erik Hatcher (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15970392#comment-15970392
 ] 

Erik Hatcher edited comment on SOLR-1485 at 4/18/17 2:01 PM:
-

There's three pieces in that previous patch:

 * {{FloatPayloadValueSource}}: the {{payload(...)}} function
 * {{PayloadScoreQParserPlugin}}: the {{\{!payload_score}}} qparser
 * {{PayloadCheckQParserPlugin}}: the {{\{!payload_check}}} qparser

The focus so far has really been the {{payload(...)}} function.  The query 
parsers need more work, as at the moment they only support a term query. 


was (Author: ehatcher):
There's three pieces in that previous patch:

 * FloatPayloadValueSource: the `payload(...)` function
 * PayloadScoreQParserPlugin: the `{!payload_score}` qparser
 * PayloadCheckQParserPlugin: the `{!payload_check}` qparser

The focus so far has really been the `payload(...)` function.  The query 
parsers need more work, as at the moment they only support a term query. 

> Payload scoring support
> ---
>
> Key: SOLR-1485
> URL: https://issues.apache.org/jira/browse/SOLR-1485
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Reporter: Erik Hatcher
>Assignee: Erik Hatcher
>Priority: Minor
> Fix For: master (7.0)
>
> Attachments: PayloadTermQueryPlugin.java, payload_value_source.png, 
> SOLR-1485.patch
>
>
> Solr has no support for Lucene's PayloadScoreQuery, yet it has support for 
> indexing payloads (via DelimitedPayloadTokenFilter or 
> NumericPayloadTokenFilter). 
> This issue adds value source and query parser support for leveraging payloads 
> created by those token filters.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org