You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Brian Yee <by...@wayfair.com> on 2018/02/07 21:32:03 UTC

Payload fields

Hello,

I am trying to use Payload fields to store per-zone delivery dates for products. I have an index where my documents are products and for each product we want to store a date by when we can deliver that product for 1-100 different zones. Since the payload() function only supports int and float, I am representing my dates as 20180210. So my payload field looks like this:
1|20180210 2|20180211 3|20180212 4|20180213 5|20180214

However when I load that data into my index and add "fl=Zone2:payload(DeliveryPayload,2)" I get the wrong result in my output. It shows me "Zone2": 20180212.

I don't understand why. The only thing I can think of is that the int is too big. Is there a size limit? If I reduce it to a 6 or 7 digit int, things work as expected. Shouldn't INT handle up to 2B?

My schema.xml looks like this:

    <fieldType name="payload_int" stored="false" indexed="true" class="solr.TextField" >
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="integer"/>
      </analyzer>
    </fieldType>

    <field name="DeliveryPayload" type="payload_int" indexed="true" stored="true"/>



RE: Payload fields

Posted by Brian Yee <by...@wayfair.com>.
I also noticed a weird pattern with the results. This is from doing fl=Zone01:payload(DeliveryPayload,01) for each zone. Can't figure out why this would happen.

               "DeliveryPayload": "01|20180210 02|20180211 03|20180212 04|20180213 05|20180214 06|20180215 07|20180216 08|20180217 09|20180218 10|20180219 11|20180220 12|20180221"
                "Zone01": 20180210,
                "Zone02": 20180212,
                "Zone03": 20180212,
                "Zone04": 20180212,
                "Zone05": 20180214,
                "Zone06": 20180216,
                "Zone07": 20180216,
                "Zone08": 20180216,
                "Zone09": 20180218,
                "Zone10": 20180220,
                "Zone11": 20180220,
                "Zone12": 20180220,




-----Original Message-----
From: Brian Yee [mailto:byee@wayfair.com] 
Sent: Wednesday, February 7, 2018 4:32 PM
To: solr-user@lucene.apache.org
Subject: Payload fields

Hello,

I am trying to use Payload fields to store per-zone delivery dates for products. I have an index where my documents are products and for each product we want to store a date by when we can deliver that product for 1-100 different zones. Since the payload() function only supports int and float, I am representing my dates as 20180210. So my payload field looks like this:
1|20180210 2|20180211 3|20180212 4|20180213 5|20180214

However when I load that data into my index and add "fl=Zone2:payload(DeliveryPayload,2)" I get the wrong result in my output. It shows me "Zone2": 20180212.

I don't understand why. The only thing I can think of is that the int is too big. Is there a size limit? If I reduce it to a 6 or 7 digit int, things work as expected. Shouldn't INT handle up to 2B?

My schema.xml looks like this:

    <fieldType name="payload_int" stored="false" indexed="true" class="solr.TextField" >
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="integer"/>
      </analyzer>
    </fieldType>

    <field name="DeliveryPayload" type="payload_int" indexed="true" stored="true"/>