如果有人以前使用过Sphinx搜索引擎...你知道它是否可以连接单词吗?

发布于 2024-08-22 19:20:47 字数 158 浏览 13 评论 0原文

当您搜索“Stack Overflow”时,Sphinx 不会显示与“Stackoverflow”匹配的结果,

这是因为 Sphinx 将“Stackoverflow”索引为一个单词……而查询是两个单词。

有谁知道如何解决这个问题? (像谷歌一样……他们可以加入查询!)

When you search "Stack Overflow", Sphinx will not bring up results that match "Stackoverflow"

That's because Sphinx indexes "Stackoverflow" as one word...whereas the query is two words.

Does anyone know how to fix this? (like Google...they can join the query !)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

热风软妹 2024-08-29 19:20:47

您可以使用词形功能将单词映射到不同的单词,或者将多个单词匹配到一个单词。如果你有很多单词想要纠正,你可以这样做。我认为如果您使用此功能,您只需执行一次搜索,并且可能比执行“或”搜索更快。

You can use the wordforms feature to map words to different words, or to match many words to a single word. If you have a lot of words you want to correct, you could do this. I think if you used this feature you would only have to do a single search, and it would probably be faster than doing an "or" search.

淡忘如思 2024-08-29 19:20:47

无需篡改提供给 Sphinx 的数据。您需要做的就是稍微修改表单处理代码中对Sphinx的搜索请求,使其包含搜索词的各种组合并使用SPH_MATCH_EXTENDED匹配模式。特别是,对于你的例子

(Stack Overflow) | stackoverflow

There's no need to tamper with data being fed to Sphinx. All you need to do is to slightly modify the search request to Sphinx in your form processing code so that it contained various combinations of search terms and use SPH_MATCH_EXTENDED matching mode. In particular, for your example

(Stack Overflow) | stackoverflow
我是男神闪亮亮 2024-08-29 19:20:47

难道你不能将搜索词组合成一个词,然后再发送给 sphinx 吗?您需要对搜索词进行所有排列,即 my search termmysearchmysearchtermsearchterm ,但这似乎可行。

Couldn't you just combine the search terms into one words before sending them to sphinx? You would need to do all permuations of serach terms, ie my search term as mysearch, mysearchterm, and searchterm, but that seems like it would work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文