Try our conversational search powered by Generative AI!

Episerver Find setup to Index multiple sites


Hey Guys,

I have episerver CMS experience, but still a rookie setting up Episerver Find in projects. 

So we have a website with 2 websites in it. (with 2 different startpages, using their own domain). 

My question is about setting up episerver find. 

I did the basics of installing the nuget packages, i created a free demo index, and setup the web.config. 

Now the indexing starts but it indexes everything in the same (demo)index. So both sites. 

What is the best practice/approach to search only pages which are in 1 site. Is that in the logic of the code or can we setup the index differently accomadate searching in specific content of 1 of the sites. 

I hope to hear about your thoughts. 


Oct 23, 2017 10:28

Hi Vishal,

This is the intended design for Find. You can filter content for particular site for any IContent types like so.

var content = SearchClient.Instance.Search<IContent>()
  .Filter(x => x.SiteId().Match("MySiteId"))
Oct 23, 2017 14:30

Cool thanks Janaka... i will try that... 

Also we have like a block type which contains a search box. And the idea is that it can only find items/pages that are hierarchically a descendant page of the page the blocks is on..

How can you search for that using Find's api. 

Oct 23, 2017 15:01

To do that use the Ancestors property to filter based on the content reference of the section of the site you want to filter against. Something like

.Filter(x => x.Ancestors().Match(contentReference.ToString());

Oct 23, 2017 15:46

thanks mate!!

Oct 23, 2017 16:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.