Fix SharePoint Online Search Ignoring Query Transform and Sort Order
Question details
Users need to fix an issue where Modern SharePoint search does not apply customized result sources, query transforms, date filters, or sorting rules correctly.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- Searching for specific documents using customized queries, date filters, or LastModifiedTime sort orders in a Modern SharePoint site.
- Observed behavior
- Modern SharePoint search ignores the custom query transform and sorting rules, sometimes displaying unexpected or older results that would normally be filtered out in classic search.
Verify your SharePoint site permissions, as managing Result Sources and adding custom web parts requires Site Collection Administrator privileges.
Implement PnP Modern Search Web Parts
Bypass the limitations of built-in Modern Search by deploying PnP Search web parts, which fully support custom query transforms and sorting.
The default Modern Search experience in SharePoint restricts deep customization and often overrides custom result sources. Deploying PnP Modern Search Web Parts allows you to regain the granular control found in Classic Search.
Navigate to the official Microsoft PnP Modern Search GitHub repository and download the latest release package.
Upload the downloaded package to your SharePoint Tenant App Catalog to make the web parts available across your sites.
Edit your Modern SharePoint page, click the '+' icon to add a new element, and select the 'PnP - Search Results' web part.
Open the web part properties pane, enter your custom query transform syntax, and configure the desired LastModifiedTime sort order.

Test the Query in Classic Search Mode
Isolate the issue by testing your query and date filters in SharePoint's Classic Search center to confirm your syntax is correct.
Escalate to Microsoft 365 Administrator Support
If outdated or unexpected results persistently appear regardless of the search interface, request backend investigation from Microsoft.
Looking for a Hassle-Free Office Suite? Try WPS Office
SharePoint search configurations can be highly complex. For an easier way to handle your daily document tasks, WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, letting you edit files locally without a steep learning curve.
- 1. Download and Install: Visit the official WPS website to download the free suite and follow the simple installation prompts.
- 2. Open Your Files: Launch WPS Office and open your existing Microsoft Word, Excel, or PowerPoint documents natively.
- 3. Edit Seamlessly: Enjoy a familiar interface to edit, format, and save your work with complete format compatibility.

Frequently Asked Questions
Why does Modern SharePoint Search ignore my custom result sources?
Modern SharePoint Search is designed with simplified built-in configurations to improve general performance and often overrides custom result sources, query transforms, or specific LastModifiedTime sortings. Classic search relies on an older, fully customizable search architecture.
What are PnP Search web parts?
PnP (Patterns and Practices) Search web parts are open-source, Microsoft-supported community extensions for SharePoint Online. They restore advanced search capabilities to Modern pages, allowing you to use custom queries, refiners, and precise sorting.
How do I check if my date filter is actually working in SharePoint?
You can test the exact search query in a Classic Search center. If the date filter and sorting work correctly there but fail on a Modern site, the issue is specific to the Modern UI's search limitations rather than your query syntax.
When should I contact Microsoft 365 Support for search issues?
If you have verified your query in both classic and modern search and still see unexpected older results that explicitly violate your query transform rules, there may be a backend indexing anomaly. In this case, your tenant administrator should open a support ticket.




