[ 
https://issues.apache.org/jira/browse/SOLR-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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}&fl=id,*_dpf,score&wt=csv&payload_term=two
    * &payload_term=two
    id,score
    1,2.0

    * &payload_term=three:
    id,score
    1,3.0
    
    * &payload_term=weighted (func=max):
    id,score
    2,100.0

    * &payload_term=weighted (func=min):
    id,score
    2,50.0
    
    * &payload_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}&fl=id,*_dpf,score&wt=csv&payload_term=two
    * &payload_term=two
    id,score
    1,2.0

    * &payload_term=three:
    id,score
    1,3.0
    
    * &payload_term=weighted (func=max):
    id,score
    2,100.0

    * &payload_term=weighted (func=min):
    id,score
    2,50.0
    
    * &payload_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

Reply via email to