SaaS CMS has officially launched! Learn more now.

How to index DefaultPrice of all markets



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,

Edited, Aug 29, 2019 6:07

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.

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.