This blog is about a very exciting functionality upon which I worked during my internship at Ques10.
Will take you through the task assigned, approach, and the final solution which I finally built. Just to make things a little interesting, you will get to know about the design pattern of a very interesting feature of Stack Overflow named Merge Tags.
Ques10 is a website just like Stack Overflow, where students from different domains ask questions and resolve queries of others.
Whenever a user asks a question, he/she has to add at least one tag to that question ‘stackoverflow works in the same manner’.
Now suppose three different users asked a question related to Machine Learning :
Ideally, all the tags refer to the same thing, so there should be just one tag. e.g.
So the task was to build a Merge Tag Tool in Django Admin, from where moderators can merge these similar tags manually and at the same time all the CRUD functionality related to tags should be handeled accordingly.
The loophole I found in the task assigned to me was that, if we built a tool from where manual merging will take place then it will be a never ending process because,
Suppose we merged children tags to parent today… Tomorrow users will again create that and this will result in never ending process.
I did some research regarding this, how others are managing this!
Obviously the best player in this field is Stack Overflow.
They maintain a Parent-Children relation inbetween tags, once you merge children tags : ml, M learning with the parent Machine Learning now system will work like this :
I added two fields named parent and children in the Tag Table and follwed the same algorithm discussed above.
Of course I had to work a lot to make sure, all the CRUD functionality related to Tag works in Sync with this new feature, also learnt a lot regarding Django Admin Panel Customization
The Biggest plus point of this was now :
Once ml is merged with Machine Learning, now in future system will automatically merge 'ml' tag with Machine Learning whenever it is created during question creation
It is now, not an never ending process.
You can visit this Stack Exchange blog to read more about this functionality.
Thanks !