What data types are typically used for tag based searching?
Looking at websites like YouTube, google, twitter, discord, and even this SoloLearn QnA section, most content is searched and or sorted by tags. It’s made me curious if there is a specific datatype built for searching through items with tags efficiently. My question is, what is most commonly used for tag searching with large sums of data? And does it vary by language? I assume it’s not just a simple loop through every single thing the website has since that would be ridiculous and absurd for the billions of things those websites search through.
Your qustion is related Sop (Search engain optimisation) Every website have there own algorithem for filtering result.
In addition to storing which tags a document has, you also want to store which documents have any given tag. This is called reverse indexing. For example, say you have your usual datastructure (sql/nosql database, textfile, etc) containing blog posts: Blog Post 1: #foo, #bar Blog Post 2: #bar Blog Post 3: #foo, #qux You'd want to add an inverted index table containing tags, and respective blog post ids: #foo: 1, 3 #bar: 2 #qux: 3 This allows for fast lookup. If you are using say an sql database then it will of course do more black magic to make searching your reverse index fast. If you want to get your hands even dirtier you could try implementing a "Trie" by hand, which allows for fast lookup in a big list of strings (your leaf nodes would still be document ids). Although you probably can't outperform an sql database.
Sumit Programmer😎😎 after doing a small bit of research it seems the most common explanations of SOP are about how to make your website more viewable or how to use it for buissness. I haven’t found much on how to create one.
Its depand on you how you want to filter your list. For example : if you want to filter your resturant list using there rating than you have to creat algo in such way that filter your resturant your list by resturant rating
Pie these large websites typically store their data in a database. Whether it is a relational data model (SQL) or key/value store (NOSQL), there are ways to use a query language to filter millions or billions of records very quickly. Databases use indexes that make searching in data very efficient.