Searching multiple subsites within same index using #Episerver FIND UnifiedSearch

This guide shows you how you can index multiple episerver solutions within same index.

Published 4th of September 2017
Episever FIND 12.5 and CMS 10

Scenario:

One corporate site www.corp.com and a couple of subsites sub1.corp.com and sub2.corp.com, each site has their own solution.

The main search/resultpage is only displayed in top site www.corp.com/search

FIND Default behavior

  1. Default behavior for Episerver FIND (and the built in schedule task job called “EPiServer Find Content Indexing Job”) is that it removes packages/namespaces from index that is not included in the solution. Depending on FIND configuration it removes the other sites content from Index.
  2. By default, when searching with UnifiedSearch, it will build a request with the siteId of the site.

How to accomplish

  1. Configure same index in all solutions
  2. On subsites, fake the siteId in configuration
  3. Build your own Scheduled Job for indexing your subsite
  4. Remove the default scheduled job

Change siteId on subsite

By default, when searching with UnifiedSearch, it will build a request with the siteId of the site. FindInitialization:

Indexing scheduled job

This job should be implemented on the subsites, and even possibly on main site.

Remove the default “EPiServer Find Content Indexing Job”

Go to admin/config tab/plug-in Manager/Episerver FIND CMS/Overview tab/untick and save

NOTICE

This works with different solutions with different namespaces, so no need to have object model implemented in all solutions.

In theory no need to do any configuration on top “search” site.

IMPORTANT

You need to have same FIND versions for the search to work. If the version is higher on subsite, the search will throw InvalidOperationException

The model item passed into the dictionary is of type ‘EPiServer.Find.ProjectionException’, but this dictionary requires a model item of type ‘System.Web.Mvc.HandleErrorInfo’.

This may be fixed with levering the bindings on Episerver.Find

Resources:

SEO terms:

  • Use the same index for multiple sites
  • Using Find to index multiple sites
  • how to search content in different EPiServer websites
  • Indexing & searching multiple sites

 

Like it? please up vote
0