A tip on debugging Sitecore search

You might find this useful if you don’t already know about it. I ran into a problem the other day where the tagging section did not work properly. No tags at all were displayed for selection, I suspected that there was something wrong with the search in the field. You can find all the info you need to debug this and just copy + paste in the search log and your favorite index viewer.

Have a look in the Sitecore search index

First thing to verify is that the index actually contains the correct information about the tags. This Sitecore installation was using Lucene so I took a look at the index with Luke and found the tags in the index. The next step was to make sure the search that the tagging field generates returns tags.

In order to do this simply look in the search log file and find the latest entry after opening an item in the Sitecore content tree. It should look something like this:
128 13:38:45 INFO ExecuteQueryAgainstLucene (sitecore_master_index): +_datasource:sitecore +(+_latestversion:1 +(+_path:11111111111111111111111111111111 +_template:68ba23fd8270467597ea4fafc7cf3ab9 +_latestversion:1)) – Filter :

To make sure this works correctly just copy the following:
+_datasource:sitecore +(+_latestversion:1 +(+_path:11111111111111111111111111111111 +_template:68ba23fd8270467597ea4fafc7cf3ab9 +_latestversion:1))

And paste it in the “Enter search expression here:” box on the Search tab in Luke. Click Search and the results should be shown in a list.

Pasted search in Luke

This is done in a very similar way with SOLR and it is very useful when figuring out problems with search.

Leave a Reply

Your email address will not be published. Required fields are marked *