Implements rules for segmentation lists. I have a requirement that forces me to use the contains method on a string. Unfortunately, this feature is not supported. Has anyone managed to make an equivalent of this method?
2 Answers
The xConnect search supports only a specific subset of queryable conditions, and it is unlikely that a workaround exists.
Interestingly, the supported search method documentation for 10.0 says that partial text search is not supported when using Azure Search provider, which implies that it is supported with Solr, but the code sample doesn't make any sense:
client.Contacts.Where(c => c.TextMatch("Mar"))
(you can ask sitecore support whether it is a typo or not btw)
And you could try solving this in a different way, for example by evaluating the facet value when it is saved using calculated facets.
Using calculated facets you can check if a facet property contains a predefined string (using normal .Contains()
method) and save the result to a new bool facet property, and check that property in the segment instead.
You can achieve this by using string data type for the Comparison variable instead of StringOperationType.
and in Sitecore, for the Comparison variable, you can create a custom multilist item folder at path /sitecore/system/Settings/Rules/Definitions
and then refer this to rule definition item:
-
The problem is that the contains function is not supported by indexes and an error occurs when trying to use it. That's why I asked this question. Feb 22, 2021 at 7:23