Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
If i try with and older version of Find (8.6.0.1055) i got results from both sites.
Unfortunately Find 9+? has .FilterOnCurrentSite() per default, but what you can do is to create an initialization module which overrides the unifiedSearchRegistry where you could exclude whatever you want. I have some code here which you can use:
using System; using EPiServer.Core; using EPiServer.Find.Helpers; using EPiServer.Find.UnifiedSearch; using EPiServer.Logging.Compatibility; using EPiServer.ServiceLocation; using EPiServer.Web.Routing; using EPiServer.Framework; using EPiServer.Framework.Initialization; using EPiServer.Find; using EPiServer.Find.Cms.Module; using EPiServer.Find.Framework; using EPiServer.Find.Cms; using EPiServer.Globalization; namespace EPiServer.Templates.Alloy.Business.Initialization { [InitializableModule] [ModuleDependency(typeof(IndexingModule))] public class FindLanguageInitialization : IInitializableModule { public void Initialize(InitializationEngine context) { var cmsunifiedsearchsetup = new EPiServer.Find.Cms.CmsUnifiedSearchSetUp(); SearchClient.Instance.Conventions.UnifiedSearchRegistry .Add<PageData>() .PublicSearchFilter((c, ctx) => c.BuildFilter<IContentData>() .FilterForVisitor(ctx.Language == null || ctx.Language == Language.None ? Languages.AllLanguagesSuffix : ctx.Language.FieldSuffix) .ExcludeContainerPages() .ExcludeContentFolders() .FilterOnCurrentSite()) //this part you could comment away .CustomizeIndexProjection(cmsunifiedsearchsetup.CustomizeIndexProjectionForPageData) .CustomizeProjection(cmsunifiedsearchsetup.CustomizeProjectionForPageData); SearchClient.Instance.Conventions.UnifiedSearchRegistry .Add<MediaData>() .PublicSearchFilter((c, ctx) => c.BuildFilter<IContentData>() .FilterForVisitor(ctx.Language == null || ctx.Language == Language.None ? Languages.AllLanguagesSuffix : ctx.Language.FieldSuffix) .ExcludeContentFolders() .FilterOnCurrentSite()) //this part you could comment away .CustomizeIndexProjection(cmsunifiedsearchsetup.CustomizeIndexProjectionForMediaData) .CustomizeProjection(cmsunifiedsearchsetup.CustomizeProjectionForMediaData); //Add initialization logic, this method is called once after CMS has been initialized } public void Preload(string[] parameters) { } public void Uninitialize(InitializationEngine context) { //Add uninitialization logic } } }
I have a EPiServer solution with two sites and i use Find .NET API-version: 9.3.0.2674.
I want to get the search results from both sites but now i only get the results from the site im currenty browsing.
Both sites are indexed and i can see the page i want in the index.
If i use TypedSearch i get all the pages but when i use UnifiedSearchFor i only get one site pages.