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/11/27 14:30:00 UTC
[jira] [Comment Edited] (SOLR-13863) payload query function support
for string encoded payloads (delimited_payloads_string)
[ https://issues.apache.org/jira/browse/SOLR-13863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16983558#comment-16983558 ]
Vincenzo D'Amore edited comment on SOLR-13863 at 11/27/19 2:29 PM:
-------------------------------------------------------------------
Hi [~mkhl], sorry not sure I got what you have written.
Just to resume why I'm here with this implementation, in first instance I wrote a new function "spayload" dedicated to delimited_payloads_string. After first pull request [996|https://github.com/apache/lucene-solr/pull/996] I was asked by [~ehatcher] to add into the payload query function this behavior, i.e. support for string encoded payloads (delimited_payloads_string).
Reading again the suggestion left by Erik in the first pull request, to identify the field type he recommended to use
{{PayloadUtils.getPayloadEncoder(fieldType) }}
instead of
{{fieldType.getTypeName().equals("delimited_payloads_string")}}
The getPayloadEncoder function returns the String "identity" for the delimited_payloads_string.
Is this enough generic? If i misunderstood your comment, could you please help me with a more detailed comment?
Thanks, Vincenzo
was (Author: v.damore@gmail.com):
Hi [~mkhl], sorry not sure I got what you are writing.
Just to resume why I'm here with this implementation, in first instance I wrote a new function "spayload" dedicated to delimited_payloads_string. After first pull request [996|https://github.com/apache/lucene-solr/pull/996] I was asked by [~ehatcher] to add into the payload query function this behavior, i.e. support for string encoded payloads (delimited_payloads_string).
Reading again the suggestion left by Erik in the first pull request, to identify the field type he recommended to use
{{PayloadUtils.getPayloadEncoder(fieldType) }}
instead of
{{fieldType.getTypeName().equals("delimited_payloads_string")}}
The getPayloadEncoder function returns the String "identity" for the delimited_payloads_string.
Is this enough generic? If i misunderstood your comment, could you please help me with a more detailed comment?
Thanks, Vincenzo
> payload query function support for string encoded payloads (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: 1h 10m
> Remaining Estimate: 0h
>
> I have the per-store pricing problem but payload function handles only numbers.
> Stores can also be in different countries, for example would be useful having with the price also the currency and other attributes related to the store.
> We could have add support for string encoded payloads fixing function query named *payload*.
> Example document:
> {
> {{ "id":"my sample doc",}}
> {{ "currencyPayload":[}}
> {{ "store1|EUR",}}
> {{ "store1|USD",}}
> {{ "store3|GBP"}}
> {{ ]}}
> }
> Querying Solr with
> {{fl=payload(currencyPayload,store3)}}
> would generate a response like the following:
> {
> {{ "response": {}}
> {{ "docs":[}}{
> {{ "id":"my sample doc", }}
> {{ "payload(currencyPayload,store3)":"GBP"}}
> {{ }]}}
> }
> {{}}}
> And executing `payload(payloadCurrency,store2)` returns `EUR`, and so on.
> You can use `payload` even as sorting function.
> {{sort=payload(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