Starting from Sitecore XP 10.0, the behavior of the Content Tree Search has been changed. Sitecore no longer fetches data from databases (or Sitecore caches) when an item ID or path is used as a search term. Instead, a query against a search index is run. The search is performed against all text fields of an item (using the Content full-text search field) and might return more results than in the previous Sitecore XP version.
To switch back to the old behavior:
using Sitecore.Diagnostics; namespace Custom.Pipelines.Search { internal class AbortIfDirectHitIsFound { public void Process(SearchArgs args) { Assert.ArgumentNotNull(args, "args"); if (args.Result.Categories.Any(category => category.Name == "Direct Hit")) { args.AbortPipeline(); } } } }
<?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <search> <processor type="Sitecore.Pipelines.Search.IDResolver, Sitecore.Kernel" patch:before="*[1]" /> <processor type="Sitecore.Pipelines.Search.PathResolver, Sitecore.Kernel" patch:after="*[@type='Sitecore.Pipelines.Search.IDResolver, Sitecore.Kernel']" /> <processor type="Custom.Pipelines.Search.AbortIfDirectHitIsFound, Custom.Assembly" patch:before="*[@type='Sitecore.ContentSearch.Client.Pipelines.Search.SearchContentSearchIndex, Sitecore.ContentSearch.Client']" /> </search> </pipelines> </sitecore> </configuration>
In Sitecore XP 10.3, the changes mentioned in the Description have been reverted, so that the Content Tree Search works taking into account an item ID and path as in product versions previous to Sitecore XP 10.0.