Search all products, regardless of Market

Member since: 2017


Is it possible to do a search for all products, regardless of which market they're on - in this situation via the LuceneProvider.

I've dug down through the code, and it seems that only if I provide MarketId in my CatalogEntrySearchCriteria do I get a result.

var criteria = new CatalogEntrySearchCriteria
                IgnoreFilterOnLanguage = true,               
                MarketId = [I have to set a market ID to get a result],
                StartingRecord = 0,
                RecordsToRetrieve = Int32.MaxValue

I could of course iterate across all markets and do multiple searches or implement my own Lucene access to the index; but I was just wondering if there was an 'out of the box' solution I could use?

I'm just trying to list all products in a catalog without doing a resursive type node-by-node list.

Thanks in advance

#181163 Edited, Aug 10, 2017 10:31
  • Member since: 2011


    Without trying, I think you should be able to use some artifial value like "NONEXISTING" for MarketId. MarketId is matched by "exclusion", so as long as the value does not match any excluded markets of an entry, it should be returned.

    As I said, I haven't tried it ...

    #181165 Aug 10, 2017 11:01
  • Member since: 2017


    Thanks for your reply - that actually looks like it might work. I'll try that approach.

    #181166 Aug 10, 2017 11:05