为全文搜索提供“用户友好”界面

时间:2022-11-24 22:46:47

We use SQL Server fulltext search for several tables on our application. We always use AND searches, e.g.:

我们在应用程序上使用SQL Server全文搜索几个表。我们总是使用AND搜索,例如:

  • "Evil" returns "Evil Dead" and "The Evil of Fu Manchu"
  • “邪恶”回归“邪恶的死亡”和“复满的邪恶”

  • "Evil Fu" returns only "The Evil of Fu Manchu"
  • “邪恶的福”只返回“富满的邪恶”

We want to keep the interface down to just a single search box and button, and we don't want people to have to learn much (if any) in the way of special syntax. We use CONTAINS rather than FREETEXTTABLE because of the AND requirement.

我们希望将界面保持为一个搜索框和按钮,我们不希望人们必须以特殊语法的方式学习(如果有的话)。由于AND要求,我们使用CONTAINS而不是FREETEXTTABLE。

The limitation is that CONTAINS does not seem to match synonyms. My question is really: does anyone out there have a pattern for "interpreting" user input to useful fulltext syntax?

限制是CONTAINS似乎与同义词不匹配。我的问题是:那里有没有人用“解释”用户输入到有用的全文语法的模式?

1 个解决方案

#1


If you had a synonym table you could look up a set of terms and run those through your CONTAINS query.

如果您有同义词表,则可以查找一组术语并通过CONTAINS查询运行这些术语。

You could use something like the Big Huge Thesaurus API

您可以使用Big Huge Thesaurus API之类的东西

#1


If you had a synonym table you could look up a set of terms and run those through your CONTAINS query.

如果您有同义词表,则可以查找一组术语并通过CONTAINS查询运行这些术语。

You could use something like the Big Huge Thesaurus API

您可以使用Big Huge Thesaurus API之类的东西