I am working with a custom SXA search query token. I want to Insert
with two different values.
foreach (var val in values)
{
args.Models.Insert(i, this.BuildModel(itemFieldName, val));
}
args.Models.Remove(model);
SearchStringModel:
protected virtual SearchStringModel BuildModel(string fieldName, string value)
{
var name = fieldName;
return new SearchStringModel("custom", FormattableString.Invariant(FormattableStringFactory.Create("{0}|{1}", name, value)))
{
Operation = "must"
};
}
But this logic is not showing search results. Is there any way to achieve this functionality?
?q=(itemid_sm:(ea15966f4e8e494384a9f210cd94d273) AND itemid_sm:(1646be1cb09d473fab86ebc9b7e5e668))
, as you can see its putting the AND operator instead of OR between the values. How can I put OR instead of AND? – PSS Sep 22 '20 at 8:29