我有一个非常简单的 SQL 表,我想将其导入到 Solr 中,但由于我想要搜索的功能,我无法确定最佳模式。
用户将开始在输入框中键入内容,在 3 个字符后,它将向服务器发送请求并提取最相关的结果,返回前 15 个匹配的 ID 和名称。
表例)
id | name
----------------
1 | boating magazines
2 | boats weekly
3 | boaters collection
4 | shipping lane
5 | ships today
搜索和预期回报(例如)
boa | [1, boating magazines], [2, boaters weekly], [3, boaters collection]
boat | [1, boating magazines], [2, boaters weekly], [3, boaters collection], [4, shipping lane], [5, ships today]
shi | [4, shipping lane], [5, ships today]
ship | [1, boating magazines], [2, boaters weekly], [3, boaters collection], [4, shipping lane], [5, ships today]
boating | [1, boating magazines], [2, boaters weekly], [3, boaters collection], [4, shipping lane], [5, ships today]
(显然这些会以 xml 形式返回)
任何有关我如何实现这一目标的信息将不胜感激。谢谢。