Solr Error : ["undefined field query"] in the logs


Description

If using a query in the data source field of a rendering on a regular (non-SXA) site, the data source might fail to be resolved with an error in the search log files on the Content Delivery instance:

ERROR Solr Error : ["undefined field query"] - Query attempted: <Sitecore Query syntax>

The issue occurs because the Sitecore Query syntax cannot be used for rendering data sources on non-SXA sites.

Solution

To resolve the issue, consider one of the following options:

Note: The solution provided in this article does not imply adding support for the Sitecore Query syntax. It prevents attempts to resolve data sources using the search indexes if the Sitecore Query syntax has been applied.

Alternatively, consider the following options: