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
Still looking into a solution for this, i'm not sure if anyone else has had this problem or not and can shed some light on it? Any help is appreciated.
Dave,
I don't remember exactly how thise code
filter = filter.And(x => x.SiteId().Match("Site1_ID"));
filter = filter.And(x => x.SiteId().Match("CurrentSite_ID"));
will be translated into an elastic query but maybe you could try with
filter = filter.And(x => x.SiteId().In(new[] {"Site1_ID", "CurrentSite_ID"}));
I know this is an old thread, but I had a hard time with this as well. Bartosz, did you ever find a solution?
This is something that may help with that. I used the solution presented here to search multiple subsites.
https://world.optimizely.com/forum/developers-add-ons-forum/Search/Thread-Container/2018/11/disable--filteroncurrentsite-for-unifiedsearch/?_gl=1*qin1fn*_ga*NzQ5Njk3MTMxLjE2NjEzNTQ5NjU.*_ga_C7SLJ6HMJ5*MTY2NjgxMzY3Ni4zMy4xLjE2NjY4MTU1MDQuNjAuMC4w
We have a requirement in our environment when using EPiServer Find where I need to search and return the results from only specific sites in our multisite environment, depending on the site where the search is being executed.
For example, in our environment we have a single site that acts as the parent site and all other sites are considered child sites of that parent:
Site1 - Parent Site
Site2 - Child Site
Site3 - Child Site
Site4 - Child Site
..... etc
Given the above scenario, if someone was on Site3 and was performing a search then the results of that search from the contents on Site3 + the results from Site1 should only be returned. Likewise if someone was on Site2 then the contents on that site should be returned + the results from Site1 should be returned, etc, etc..
The problem i am running into is that in a UnifiedSearch I cannot target the 2 sites when on one of the child sites, meaning if i do the search on Site3 then it's only giving me the contents from Site3 and not from Site1 even when i'm adding a filter to include Site1 in the search results.
Below is the code i'm using:
I'm not sure what i'm doing wrong, but i can't seem to return the results from anyting other than the current site i'm on, which defeats the purpose for what we need to accomplish.
Does anyone know anything about this? Or what i might be missing?