Forum Discussion
Modern Pages - Highlighted content not filtering search results for pages in other site collections
Hi all,
I want to show pages from a different site collection using the highlighted content with a filter on Content includes the words to only show articles with specific content. This works just fine if the pages are created in the same site, but when I use All sites as my source, it appears that the filters don't work (there are plenty of results, but no filtering)
Has anyone else experienced this? Is it a bug, or is there some kind of work-around?
- Mikael SvensonSteel Contributor
Clearly a bug in the code which generates the KQL filter. It's a logical error where the code is not adding () around the content type id filter, messing up interpretation of AND and OR in the final query. So a proper boolean error. Should be reported.
- Mikael SvensonSteel Contributor
I've reported it so we'll see what happens.
- Mikael SvensonSteel Contributor
Thanks to Elsa Naumann who noticed the issue with () and contenttypeid has been fixed. Guess stuff happens in the dark :-D
The query is however not optimized adding unneeded OR's - but who cares right? :)
Hi Elsa Naumann,
You can select 3 scopes.
* this site
* This site collection
* All sites
This site will indeed only select from the current site
This site collecction picks data from the current site collection
The All sites option however is giving you exactly what you want. Data from all sites
I then set a filter
Now my documents with the word business in the title field are shown.
Can you give some more detail on the kind of filters that you are using?
- Elsa NaumannBrass Contributor
Hi Pieter Veenstra and thank you for your quick reply.
This approach works really well when the scope is "This site" or rather, the pages are in the same site. But when I do the same as below, with the "All sites" scope (as I know the pages I want to highlight are in a different site collection) the filters don't refine the results as accurately, for example titles not including the defined word are not excluded.
Hi Elsa Naumann,
How do you do a not contains? The sdtandard filter options don't have this.
I'm assuming that you are using a Maneged property filter here and then select "Doesn't contain" filter. This would now use the search engines managed properties. Yoju will find the same sisues as with search web parts. The problem might not be the web part.
Could you try on a traditional team site to use a search results web part?
In the past I've seeen issues with title fields.
I would recommend yusing one of the RefinableStringXX properties instead.