We want to build a search interface that pulls results both from media library and different content paths, to include both pdf and standard content items. What is the best way to structure the predicate statements? Our current code looks like this:
var predicate = PredicateBuilder.True<SearchResultItem>(); predicate = predicate.And(i => i.Paths.Contains(Paths.PdfsFolderID)); predicate = predicate.And(i => i.Content.Contains(Key)); predicate = predicate.And(i => i.TemplateName.Equals("pdf")); IQueryable<SearchResultItem> queryable = context.GetQueryable<SearchResultItem>().Where(predicate); queryable.Count();
This brings in the media library pdf files that we want included. How do we go about adding in the content items? We have tried predicate.or to include alternate paths and templates, but so far, no luck. In case it is pertinent, we use Lucene, and are on on SC 7.2.
Thanks in advance!