Can somebody advise idea, how to match user input (few words) to appropriate tags in system (each of them also 1 or N words)?
Here is sample to demonstrate problem: I have a Tags, assigned to objects. For example (tags are separated by COMA, but in real life I have relation to table)
Object Tags
Earth World, reality
World of warcraft 3 World Of warcraft, virtual reality
quake game, virtual
I would like to get following:
User Enter 'World': result is 'Earth'
User Enter 'World of warcraft': result is 'world of warcraft 3'
That was simple, exact search. But:
User Enter 'game world': results should be search by two tags - 'earth', 'quake'
User enter 'virtual reality': returns all 3 records
User enter 'reality virtual': Earth, quake
I am using t-sql for search, full-text-search is enabled and used to also find a keywords in main text. C# is middle tier. But I prefer to have solution on t-sql level.
UPDATE 1 First what I am going to do, is to disallow spaces in tags, like on stackoverflow. Any other ideas are upreciated.