Deleting solr documents from Solr Admin

 

Brief Introduction

As we all knows many of the biggest websites on the internet use Solr as their search and navigation engine because it is extremely dependable. It offers centralised configuration, automated failover and recovery, distributed indexing, replication with load-balanced querying, and more.

But sometimes while using it we face duplicates issues on to the sites search pages with broken image links which could not be resolved by either re-indexing the content tree/item in master/web databases or publish/unpublish the item/tree. when we query into the solr admin we found there were duplicates present into the respective cores. so below the steps you may follow to delete the respective document directly from the desired index. 


Step 1 : Go to the respective solr server which you have configured for you sitecore instance for example http://localhost:8984/solr/#/




Step 2 : Select the respective core(from core selector dropdown) in which you want to delete the duplicate records 




Step 3 : Type you desired query into "q" parameter to fetch the respective results or the document which you want to delete 




Note: Due to confidentiality I can't show actual query on live indexes of production site hence using my sc10.2 vanilla instance to elaborate the procedure, steps would be similar to perform on any instance(Stage/UAT/Prod)


Step 4 :  In above step3 we can see we found 3 documents , note down the _group id for that document which you want to delete, 



Step 5 : Now suppose this _group : "fa6100aff1b24aafb5f31686f9979090" is the culprit here 😛 note down its id and open the Documents window as shown below.




  • Request Handler will be /update 
  • Document Type should be XML or JSON
  • In the Documents text editor type your delete query which includes the parameters _group field.


Step 6 : All set now , just submit your document and re-run the query in "Query" section to look for that document, 



You can see now we left with only 2 documents 


Also you can include more fields like _templatename , _language(for you multilingual sites) etc to your Documents editor using AND operator as shown below




Finally we left out with only 1 results now initially it was 3 as shown below 



Conclusion

Although I know this solution might not be feasible for the case where we may have lot of duplicates documents in index,  in that case we need to look for any other workaround but yeah I believe this will be helpful for some of people who might be struggling with this 😐

This is all about this blog 🙏

Happy Learning!!!!!!





Comments

Post a Comment

Popular posts from this blog

Uninstallation of Installed Sitecore Instance Using SIA(Sitecore Install Assistant)

How to Implement Custom Personalization rule in Sitecore