Sitecore 9.3
What I have till now:
I am able to filter items based on a template using the search context.
var unversionedImageTemplateId = ID.Parse(Constants.UnversionedImageTemplateId);
var jpegTemplateId = ID.Parse(Constants.Jpeg);
var results = context.GetQueryable<SearchResultItem>()
.Where(x => x.TemplateId == unversionedImageTemplateId || x.TemplateId == jpegTemplateId)
What I am trying to do:
I want to put one more condition based upon the value of a field, a check box.
What I tried:
- I tried using
.Where
after the code I have. - I tried applying the condition using
&&
in the sameWhere
command.
But I always get the following error.
Exception: System.NotSupportedException
Message: The method 'get_Item' is not supported.
Source: Sitecore.ContentSearch.Linq
Any idea how to move ahead with it?