We are having the below item structure in sitecore and using Lucene Index,
Home
-- Products A Repository
- Product 1
- Product 2
- Product 3
-- Products B Repository
- Product 1
- Product 2
- Product 3
Products A & Product B repository items is using Same template called product. We have created new common custom index start location we set as Home.
we are trying to use the below code
var index = ContentSearchManager.GetIndex(indexName);
using (var searchContext = index.CreateSearchContext())
{
var searchText ="Product";
var items = searchContext.GetQueryable<SearchResultItem>()
.Where(x => x.Content.Equals(searchText) && x.Language == query.Language)
.OrderByDescending(x => x.Updated)
.GetResults();
}
but we are not sure how to set the Index Search Start location to search the item from the particular repository.
Update:
Your Solution Works well , i marked as answer