I was trying to apply a filter in a
Search Result Web Part in order to display items that match only with a specific content type and belonging to a specific sub site.
It was annoying to me that the property
Path neither the property
ParentLink worked as expected. As many times, the search engine just returned 0 results.
This was the filter used in Query Tool:
Talking with my friend Ben about the scenario we are trying to figure out why. Finally we noticed that OOB in SharePoint, when create a new
Publishing Site Collection or
Enterprise Wiki Site Collection (or custom WT inheriting in these), automatically the Manage Navigation is configured and with this one “Create friendly URLs for new pages automatically” option.
Navigation by default enables the options:
So, If you are in the scenario in which you need to do some filter using Site-scoped pages or do you prefer not enable the friendly urls in your sites, then you should disable the Create friendly urls option.
We should use this object in JSOM classes: >
The exact method is
This is the code to disable the Create Friendly URLs for New Pages behavior: