Hi,

I have a requirement where we need to sort the prices present for products
from all the user stores.
Let us assume if a product is present in 3 stores(store1001,1002,1003) ,i
have created the following fields in my schema.xml

     *  <field name="storeid_str_mv" type="string" indexed="true"
stored="true" multiValued="true"/>
        <field name="productCode" type="string" indexed="true" stored="true" />
        <dynamicField name="*_price"  type="double"    indexed="true" 
stored="true"/>
        <dynamicField name="*_price_store_range_string"  type="string"   
indexed="true"  stored="true"/>     *

In my case price range is not calculated in a dynamic way, it is
predefined(0-10$,10-20$,20-30$,30$ Above) i am able to achieve this, but
while sorting since the name(S1001_price) is present in both the records as
shown below,i am not able to sort by price saying sort by S1001_price
asc,S2001_price asc
which gives me incorrect result.

*<doc>
                  <field name="id">PRODUCTA</field>
                  <field name="productCode">PRODUCTA</field>
                  <field name="storeid_str_mv">S1001</field>
                  <field name="storeid_str_mv">S1002</field>
                  <field name="S1001_price">9</field>
                  <field name="S1002_price">11</field>
                  <field name="price_store_range_string">$0-10</field>
                  <field name="price_store_range_string">$10-20</field>
                  <field name="price_store_range_string">above 30$</field>
        </doc>
        <doc>
                  <field name="id">PRODUCTB</field>
                  <field name="productCode">PRODUCTB</field>
                  <field name="storeid_str_mv">S1002</field>
                  <field name="storeid_str_mv">S1001</field>
                  <field name="S1002_price">13</field>
                  <field name="S1001_price">25</field>
                  <field name="price_store_range_string">$10-20</field>
                  <field name="price_store_range_string">$0-10</field>
         </doc>*

Is there any better way to model this so that i can sort these prices?


Regards,
raj



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Approach-to-Sorting-Prices-tp4121114.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to