Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

How to index DefaultPrice of all markets

Vote:
0

Hi, 

I have some code lines as this

            var markets = _marketService.GetAllMarkets();
            foreach(var m in markets)
            {
                conventionBuilder.IncludeField(x => x.DefaultPriceByMarket(m.MarketId));
            }

And I expected that Find would indexed n field correspond the quantity of market but I see only 1 field DefaultPriceByMarket with 1 product in Find Explore (as below)

"m.MarketId.DefaultPriceByMarket$$number": 32.5,

How can I index all DefaultPrice of all market? And what is the name of those fields that I can use in code?

Thank you for your answer,

#206707
Edited, Aug 29, 2019 6:07
Vote:
0

I don't think you can pass a parameter to an extension method used as convention. The "workaround" would be change your extension method to DefaultPriceByMarkets, which contains a dictionary (Dictionary<string, Money>) of default prices in all markets.

#206718
Aug 29, 2019 9:11
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.