Untangling the Sitecore Search LINQ to SolR queries

Problem

It can be very difficult to identify why you do not get the search results you expected from Sitecore Search, but there is a simple way to help untangle what is going on.

Solution

It is possible to see the query that Sitecore generates and sends to SolR and then use the query on the SolR instance to see what data is returned to Sitecore.

This is such a huge help when trying to understand why your queries do not work!

Step 1 – Find the Query that was sent to SolR from Sitecore

Sitecore logs all the queries it sends to SolR in the standard sitecore log folder, look for files named Search.log.xxx.yyy.txt .

Step 2 – Execute the query in your SolR instance

Go to your Solr instance, and use the core selector drop down to select the index your Sitecore Search query is being executed against.

Select Query, from the menu

Then paste the query from the sitecore log, and you can see the result that is returned to Sitecore.

This has helped me a lot, so I hope this helps others untangling their search results using Sitecore Search 🙂

 

 

 

2 thoughts on “Untangling the Sitecore Search LINQ to SolR queries

  1. Dhananjay Kurekar

    Hi Alan, Thanks. This is very good way to resolve these issues and I have been using this approach a lot and has been very useful.

    Also, there also seems to be a handy built in tool in Powershell Toolbox -> Index Viewer starting with Sitecore version 9.3. I guess this would also be helpful for troubleshooting the indexing issues for future versions.

    Reply
  2. dhananjaykurekar

    Hi Alan, Thanks. This is very good way to resolve these issues and I have been using this approach a lot and has been very useful.

    Also, there also seems to be a handy built in tool in Powershell Toolbox -> Index Viewer starting with Sitecore version 9.3. I guess this would also be helpful for troubleshooting the indexing issues for future versions.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.