Friday, March 11, 2022

Troubleshooting Sitecore GraphQL search query using SOLR - Part-2

 In this part, I will explain the troubleshooting steps with a sample example. 

 Use case: 

        In this scenario mentioned below, the articles are tagged using different Grades. I have used the Sitecore Tagging repository to create the tag. Based on the Grades(Tags), they should be grouped and displayed in the application and for fetching it from Sitecore we are using GraphQL query.

Sitecore Structure:

Article-List:


Tag Repository:

Mapping between tag and Articles:


SOLR Interface

        We have to identify, how the fields are getting indexed in SOLR. Let's take a single item "full path" and check it in the SOLR server.

 solr query: _fullpath:"/sitecore/content/sample-prjct/Content/MainItem/Article/Article1"



Check the field name semantics in the SOLR result.


Now we have identified how the field is getting displayed in index and value stored. Will start the Sitecore GraphQL query and check the results of the article.

    Sitecore GraphQL

                   I have searched the article which has been tagged Grade-1 (Tag) under the Article folder path and it returned the result.
                 

SOLR Interface                   

            Now troubleshoot the same query in the SOLR server and execute it to check the result.

              solr-query: _path:"4a0feb9686dd44c68a6d0cb112e54a46" && __semantics:"a4f9f07cb31b42ca98805433fadfcf63"




Here the results are matching if in any case, both do not seem to return the same result then Rebuild the index from Index Manager.

No comments:

Post a Comment