Hi Ben,

You can actually look at indexing single valued documents i.e. a different
one for every store and then group by on the product id.
Have a look at this presentation by Adrian Trenaman at the Lucene
Revolution earlier this year:

Presentation:
http://www.slideshare.net/trenaman/personalized-search-on-the-largest-flash-sale-site-in-america
Video: http://www.youtube.com/watch?v=kJa-3PEc90g

Hope that helps you.



On Mon, Oct 28, 2013 at 5:06 PM, bengates <benga...@aliceadsl.fr> wrote:

> Hello,
>
> I'm pretty new to Solr, and I have a question about best practice.
>
> I want to handle a Solr collection with products that are available in
> different shops.
> For several reasons, the price of a product may be the same or vary,
> depending the shop's location.
>
> What I don't know how to handle correctly is the ability to have a price
> that is a multivalued notion, which value depends on another field.
>
> Imagine the following product into the collection :
> {
>         id: 123456,
>         name: "The Wonderful product",
>         SellableInShop: [1, 3],
>         Price: 0,
>         PriceInShop1: 34.99,
>         PriceInShop2: 0,
>         PriceInShop3: 38.99
> }
>
> Behaviour I want when the user searchs for "wonderful" after selecting the
> shop #3
> /query?q=wonderful AND SellableInShops:3
>
> {
>         id: 123456,
>         name: "The Wonderful product",
>         SellableInShop: [1, 3],
>         Price: 38.99
> }
>
> My question is : how to fill, at query-time, the content of a field
> "Price",
> depending on 2 other fields : SellableInShop and PriceInShop3 (PriceInShop2
> if SellableInShop == 2, PriceInShop1 if SellableInShop == 1, etc) ?
>
> Thanks a lot,
> Ben
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Field-Value-depending-on-another-field-value-tp4098047.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 

Anshum Gupta
http://www.anshumgupta.net

Reply via email to