I see you're facing a common challenge with the portal search in Power Pages when using the Enhanced Data Model. It's frustrating when managed components, like the 'Site Component' table for web pages, don't allow for direct configuration.
You are correct in your observation. Because the Site Component table is a managed system table, you cannot edit or remove its "Portal Search" view to prevent it from being indexed. However, there is an effective way to achieve your goal by modifying a specific site setting.
The solution is to adjust the search/filters site setting. This setting controls which entities appear in the search dropdown filter. By modifying it, you can remove "Web Pages" and ensure that even the "All" filter only targets the entities you specify.
How to Exclude Web Pages from Search Results
Follow these steps to update the site setting and limit the search exclusively to Knowledge Articles:
- Open the Portal Management App: Navigate to your Power Pages environment and open the Portal Management model-driven app.
- Navigate to Site Settings: In the left-hand navigation pane, find and select Site Settings under the "Website" section.
- Find the search/filters Setting: Look for the site setting named search/filters.
- If it doesn't exist, you will need to create a new one.
- If it does exist, open it to edit its value.
- Modify the Value: The default value for this setting often looks something like this:
- Content:adx_webpage,adx_webfile;Knowledge:knowledgearticle
- To restrict the search to only Knowledge Articles, change the entire value to:
- Knowledge Articles:knowledgearticle
- Save and Clear Cache: Save your changes to the site setting. Afterward, clear the server-side cache for your portal by navigating to /_services/about and clicking Clear cache.
After completing these steps, the search filter dropdown on your portal will no longer show "Web Pages" or other entities. The "All" option will now effectively only search within the single entity you have defined: Knowledge Articles.
Your existing Search/Query site setting, +(@Query)_logicalname:knowledgearticle, is still valuable. It acts as a Lucene query to boost or filter results within the searched entities. By combining that with the search/filters modification, you ensure the search is both scoped correctly and gives preference to the right fields.
I hope this helps you configure the search exactly as you need it.
Best Regards,
Jerald Felix