Hi Paul,
I foundation the problem.
I have a custom search result item classic which contained a property named Tagscase ejere the indexfield was named tagscase. I know from other indexfield named that the suffix og the indexfield could bedste disregarded, so I removed _sm from the name.
Bur found out agter adding the suffix to the indexfield that IT worked. Like this: tagscase_sm.
Noe IT retuned WhatsApp expected from Contains method in the Enumable property .
]]>Your variables and method naming is too generic for me to understand what it is you’re trying to do.
]]>Im sttrugling with this Contains(ID) of the index array example here
Indexfield queried in Solr:
“tagscase_sm”:[“5a8e142612724fd995bf662dcc06f0c3”,
“fa9fdd2f5d684833ac25c7c9994c4b39”],
SearchResultItem class:
[System.Runtime.Serialization.DataMemberAttribute]
[IndexField(“tagscase”)]
public virtual Enumerable FooCase{ get; set; }
var isFooIncluded = PredicateBuilder.True();
List idsFoo = Somemethod();
foreach (var i in idsFoo)
{
isFooIncluded = isFooIncluded .And(x => x.FooCase.Contains(i));
}
using (var context = ContentSearchManager.GetIndex(“sitecore_web_index”).CreateSearchContext())
{
return context.GetQueryable()
.Where(isFooIncluded )
.ToList();
}
It does not return any items in list even though I know that the search item includes the ids in the array.
I have tried to hardcode the ID inside Contains but it still does not work.
I have tried to change the idsFoo to an array instead idsFoo.ToArray()
Still does not work.
Glad it helped Zach
]]>