从首先返回的全文搜索中获取精确匹配?
例如,我使用下面的代码:
SELECT *, (MATCH (`wm`, `locn`, `gns`) AGAINST('foot locker')) AS score FROM `example_table` WHERE MATCH (`wm`, `locn`, `gns`) AGAINST('foot locker')) order by score DESC;
但是,即使 wm
列中存在精确匹配,精确匹配直到第 8 个结果才会出现。前面的也都有这个短语,但也有一些后面的文字。我检查了 locn
、gns
字段以了解它们的比较情况,但没有什么真正突出的地方可以让其他人得分更高。
我读了一些关于使用 BOOLEAN MODE
的文章,但我读到的内容似乎都无法满足我的需求。
I am using the below code for example:
SELECT *, (MATCH (`wm`, `locn`, `gns`) AGAINST('foot locker')) AS score FROM `example_table` WHERE MATCH (`wm`, `locn`, `gns`) AGAINST('foot locker')) order by score DESC;
However even though EXACT matches exist in the wm
column, the EXACT match doesn't appear untiil the 8th result. The ones ahead of it all have the phrase too, but also some following text. I checked the locn
, gns
fields to see how they compared and nothing really stands out that should make the others score higher.
I did some reading about using BOOLEAN MODE
but nothing I read there seemed like it would help my needs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,如果这对其他人有帮助,我就可以通过这样做实现我想要的目标:
Ok, if this helps anyone else I was able to achieve what I wanted by doing this: