Inconvenient searching Lists for pages with Friendly URLs
SharePoint 2013 Search allows you to easily find the content that you are looking for unless you’re looking for pages with Friendly URLs in the list view.
Finding information is easier with search
With improved search capabilities in SharePoint 2013 it matters less where the content is stored in your Site or even Farm. By optimizing your search configuration you can be a query away from the content that you are looking for. One of the great things about SharePoint 2013 Search is that it’s everywhere in the interface allowing you to search for content instantaneously.
One of the places where you will find search is in List Views. Using the search box on top of the view, you can quickly search through the contents of the currently opened List. This capability is extremely useful with large lists, where browsing for the content would be too cumbersome.
Assuming that you know what you are looking for, finding the right content using search in a List View shouldn’t be too difficult. After all, all you need to do is to type a query and press enter. Unfortunately in reality things are a bit more complicated.
Inconvenient searching list for pages with Friendly URLs
One of the new Content Management capabilities of SharePoint 2013 is Managed Navigation with Friendly URLs. Using Managed Metadata you can model the navigation hierarchy of your site and specify Friendly URLs for your Publishing Pages. Unfortunately, if your pages have Friendly URLs defined, you will not be able to find them using the search field in a List View.
When searching a List for contents, SharePoint executes an AJAX POST call including the search query:
The scope of the search query is narrowed by automatically appending the URL of the currently opened List to the search query. This is done server-side after submitting the query and before the query is executed. The problem with this is, that the List URL is searched for in the Path Managed Property, which in case of pages with Friendly URLs contains the Friendly URL rather than the Physical URL with the List URL in it. As a result no pages are found even though they are right there in the List.
What can we do about it?
The short answer is: not much. The challenging part of this inconvenience is the fact that the List URL is appended to the query on the server and there are no parameters or modifiers that can be set to prevent this from happening. An alternative would be to rewrite the search box and make it use for example the List ID as a way to limit the search results to the current List, but this is a rather cumbersome process involving more than just a few lines of code.