我正在使用 asp.net mvc 开发网站。有一种形式要求用户将一些信息与类似于 stackoverflow 的标签一起放置。此标签信息保存在字段标签中的同一个表中。
现在我想向他们展示从列表中选择标签的帮助(与在 stackoverflow 中相同)。 我怎样才能从表中提取它。一次又一次地运行查询会不会太多 对于他们键入的每个字母,因为我将从我的表格中提取唯一标签。 或者我应该有另一个表 tagslookup,我应该在其中保存唯一标签。
帮助将不胜感激。
问候
Parminder
最佳答案
当我们不得不做这样的事情时,我们将“标签”(单词)存储在内存中并创建了一个 search tree .
Wont it be too much to run the query again and again for each letter they type, because I will be extracting unique tags from my table.
这确实因具体情况而异。就个人而言,我不会每次都去数据库,但它可能适合您的情况。
关于c# - stackoverflow 中的标签列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2849625/