Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13863

payload query function support for string encoded payloads (delimited_payloads_string)

    XMLWordPrintableJSON

Details

    Description

      After a talk with Erick Erickson I was asked to incorporate this in Solr.

      https://lucene.472066.n3.nabble.com/Solr-Payload-example-td4451173.html

      I write here a simplified version of the problem in order to be easier to explain:

      I have a problem like 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

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              v.damore@gmail.com Vincenzo D'Amore
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h
                  3h