如何使用 Lucene.NET 构建自动完成/建议?
如何使用 Lucene.NET 构建自动完成/建议?
How-to build AutoComplete / Suggestions with Lucene.NET ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何使用 Lucene.NET 构建自动完成/建议?
How-to build AutoComplete / Suggestions with Lucene.NET ?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
这里的回复非常简单,它会帮助您开始。
SpellChecker 项目是 lucene.net contrib 的一部分,将为您提供 Google 的“您是说吗?”像功能一样,检查一下。
对于自动完成,您可以在文本查询末尾附加一个 *。所以 ja* 将返回 java、jack、jane 等。此外,*va 将返回 java、lava 等(尽管您必须明确允许前导通配符)
希望这会有所帮助
Very simple response here, it'll get you started.
The SpellChecker project, which is part of lucene.net contrib, will give you Google's "Did you mean?" like functionality, check that out.
For AutoComplete, you could append an * at the end of the text query. So ja* would return java, jack, jane, etc. Also, *va would return java, lava, etc (although you have to explicitly allow leading wildcards)
hope this helps
创建一个包含进入您的应用程序的所有搜索查询的数据库。 (查询日志)
创建一个具有相似字段的表
,然后进行搜索,其中查询文本以用户正在搜索的内容开头,并按出现次数降序排列。
create a database of all search queries coming into your application. (query log)
create a table that has similar fields
then do a search where the query text starts with what the user is searching for and order by the occurrence descending.