MySQL 具有 MATCH return 奇怪结果顺序的全文搜索查询
MySQL Full-Text search query with MATCH return strange result order
我需要使用以下查询查询 table:
SELECT cards.name, MATCH(`cards.name`) AGAINST("Swiftfoot Boot") AS relevance
FROM cards
WHERE MATCH(`cards.name`) AGAINST("Swiftfoot Boot")
ORDER BY relevance DESC;
这是我的 db-fiddle link 模式和记录。
如果您 运行 查询,您可以看到具有最高相关性的第一个结果是“Boot Nipper”,但我希望有“Swiftfoot Boots”(注意 's'结尾)。知道为什么会出现这个奇怪的订单以及如何解决它吗?
Natural Language Full-Text Searches
Every correct word in the collection and in the query is weighted according to its significance in the collection or query. Thus, a word that is present in many documents has a lower weight, because it has lower semantic value in this particular collection. Conversely, if the word is rare, it receives a higher weight. The weights of the words are combined to compute the relevance of the row. This technique works best with large collections.
我需要使用以下查询查询 table:
SELECT cards.name, MATCH(`cards.name`) AGAINST("Swiftfoot Boot") AS relevance
FROM cards
WHERE MATCH(`cards.name`) AGAINST("Swiftfoot Boot")
ORDER BY relevance DESC;
这是我的 db-fiddle link 模式和记录。
如果您 运行 查询,您可以看到具有最高相关性的第一个结果是“Boot Nipper”,但我希望有“Swiftfoot Boots”(注意 's'结尾)。知道为什么会出现这个奇怪的订单以及如何解决它吗?
Natural Language Full-Text Searches
Every correct word in the collection and in the query is weighted according to its significance in the collection or query. Thus, a word that is present in many documents has a lower weight, because it has lower semantic value in this particular collection. Conversely, if the word is rare, it receives a higher weight. The weights of the words are combined to compute the relevance of the row. This technique works best with large collections.