Limit product listing and search-results based on a product text-field

Hi

I want to limit the products shown on the Accelerator-site (category pages and search-results) to only show products with a certain text set on a text-field on the products.

I have tried adding a tag in ProductSearchServiceDecorator.cs like this (We are using Elastic search):

tags.Add("LimitProductTextField", new HashSet<string>() { "123" });

But it does not work, I get 0 results. However if I add a tag for a bool-field; that works:

tags.Add("LimitProductBoolField", new HashSet<string>() { bool.TrueString });

Any idea of what I might be doing wrong? Or is it not possible to add this type of limiting tag?

Litium version: 7.4.2

Are either LimitProductTextField or LimitProductBoolField added as filters in your website? I believe they’re not added as tags to the search index otherwise. Field values are instead added to the Content property.

You could maybe adjust the indexing class so your field is added as a tag or extend the ProductDataModel to index it specifically.

The fields were added as filters, but not added as to be indexed for the field template

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.