You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Vincenzo D'Amore (Jira)" <ji...@apache.org> on 2019/10/23 15:48:00 UTC

[jira] [Updated] (SOLR-13863) Add a query function that helps to read and sort string payload field (delimited_payloads_string)

     [ https://issues.apache.org/jira/browse/SOLR-13863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincenzo D'Amore updated SOLR-13863:
------------------------------------
    Description: 
I started to use payloads because I had the classical per-store pricing problem.
 But payload function handles only numbers, but stores can also be in different countries, I mean for example would be useful also have the currency and other attributes related to the store.

Adding a function query named *spayload* that helps to read and sort payload field *delimited_payloads_string*.

Example document:

{
 {{  "id":"my sample doc",}}
 {{  "currencyPayload":[}}
 {{    "store1|EUR",}}
 {{    "store1|USD",}}
 {{    "store3|GBP"}}
 {{  ]}}
}

Querying Solr with

{{fl=spayload(currencyPayload,store3)}}

would generate a response like the following:

{{{}}
{{ {{  "response":{}}}}
{{ {{      "docs":[}}{}}
{{         "id":"my sample doc", }}
{{         "spayload(currencyPayload,store3)":"GBP"}}
{{ {{      }]}}}}
{{ {{   }}}}}
{{}}}

And executing `spayload(payloadCurrency,store2)` returns `EUR`, and so on.

You can use `spayload` even as sorting function.

{{sort=spayload(payloadField,value) asc}}

 

  was:
I started to use payloads because I had the classical per-store pricing problem.
But payload function handles only numbers, but stores can also be in different countries, I mean for example would be useful also have the currency and other attributes related to the store.

Adding a function query named *spayload* that helps to read and sort payload field *delimited_payloads_string*.

Example document:

{{{}}
{{  "id":"my sample doc",}}
{{  "currencyPayload":[}}
{{    "store1|EUR",}}
{{    "store1|USD",}}
{{    "store3|GBP"}}
{{  ]}}
{{ }}}

Querying Solr with

{{fl=spayload(currencyPayload,store3) }}

would generate a response like the following:

{{{}}
{{  "response":{}}
{{      "docs":[}}{{{ }}
{{         "id":"my sample doc", }}
{{         "spayload(currencyPayload,store3)":"GBP" }}
{{      }}}{{]}}
{{   }}}
{{ } }}

And executing `spayload(payloadCurrency,store2)` returns `EUR`, and so on.

You can use `spayload` even as sorting function.

sort=spayload(payloadField,value) asc

 


> Add a query function that helps to read and sort string payload field (delimited_payloads_string)
> -------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-13863
>                 URL: https://issues.apache.org/jira/browse/SOLR-13863
>             Project: Solr
>          Issue Type: New Feature
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: query parsers, search, SearchComponents - other
>            Reporter: Vincenzo D'Amore
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> I started to use payloads because I had the classical per-store pricing problem.
>  But payload function handles only numbers, but stores can also be in different countries, I mean for example would be useful also have the currency and other attributes related to the store.
> Adding a function query named *spayload* that helps to read and sort payload field *delimited_payloads_string*.
> Example document:
> {
>  {{  "id":"my sample doc",}}
>  {{  "currencyPayload":[}}
>  {{    "store1|EUR",}}
>  {{    "store1|USD",}}
>  {{    "store3|GBP"}}
>  {{  ]}}
> }
> Querying Solr with
> {{fl=spayload(currencyPayload,store3)}}
> would generate a response like the following:
> {{{}}
> {{ {{  "response":{}}}}
> {{ {{      "docs":[}}{}}
> {{         "id":"my sample doc", }}
> {{         "spayload(currencyPayload,store3)":"GBP"}}
> {{ {{      }]}}}}
> {{ {{   }}}}}
> {{}}}
> And executing `spayload(payloadCurrency,store2)` returns `EUR`, and so on.
> You can use `spayload` even as sorting function.
> {{sort=spayload(payloadField,value) asc}}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org