使用 php 实现自动完成的 Solr 配置

发布于 2024-12-20 14:10:11 字数 584 浏览 5 评论 0原文

我如何索引我的数据并配置 solr 和 solr 中的搜索选项,以便可以实现具有以下要求的自动完成功能(如 google):

产品: - 我们有带有标题、描述、ID 的产品,例如标题:toshiba tecra s1: centrino 1.5 ghz/xp pro/15.0" tft/40 gb/256 mb+256mb/cd-rw-dvd-rom/lan/无线上网 - 该产品或该产品的字段必须以以下方式建立索引(用户搜索搜索词的方式没有区别,例如 TOSHIBA 或 tOSHiba) - 如果用户开始输入前三个字符“tos”最多。 20 个结果(完整的标题(短语),例如“toshiba tecra s1: centrino 1.5 ghz/xp pro/15.0” tft/40 gb/256 mb+256mb/cd-rw-dvd-rom/lan/wi-fi”)应该出现在自动完成框中。 - 如果用户输入两个术语“toshiba tecra”,则搜索结果必须更加精确,并且只应显示包含(连贯的)术语“toshiba tecra”的所有文档。

如果能得到任何关于此的提示,什么样的提示,那就太好了要使用的分词器/搜索组件等。

我正在使用 solr 版本 3.5

谢谢你的想法 拉莫

how do i have to index my data and configure solr and my search options in solr, that an autocompletion (like google) with the following requirements is possible:

Products:
- We have products with their titles, descriptions, id's, e.g. for the title: toshiba tecra s1: centrino 1.5 ghz/xp pro/15.0" tft/40 gb/256 mb+256mb/cd-rw-dvd-rom/lan/wi-fi
- this products or fields of this product has to be indexed in such a way that the following should be possible (no differentation how a user search for the searchterm, e.g. TOSHIBA or tOSHiba)
- if a user starts entering the first three characters "tos" max. 20 results (the complete title (phrase) e.g. "toshiba tecra s1: centrino 1.5 ghz/xp pro/15.0" tft/40 gb/256 mb+256mb/cd-rw-dvd-rom/lan/wi-fi") should appear in the autocomplete box.
- if a user enters e.g. two terms "toshiba tecra" the searchresult must be more precisly and just all documents should be shown, that contain the (coherent) terms "toshiba tecra"

It would be great to get any hints for this, what kind of tokenizer/searchcomponent etc. to use.

I'm using solr Version 3.5

Thank you for oyur thoughts
Ramo

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

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

发布评论

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

评论(1

世界如花海般美丽 2024-12-27 14:10:11

Solr 3.X 有一个内置的 Suggester 组件,它允许您在有限的字段上构建建议。

以下链接提供了实施细节 -
1. http://lucidworks.lucidimagination.com/display/solr/Suggester
2. http://solr.pl/en/ 2010/11/15/solr-and-autocomplete-part-2/

对于替代方法,您可以检查EdgeNGrams 实现 或 < a href="http://wiki.apache.org/solr/TermsComponent" rel="noreferrer">术语组件。

Solr 3.X has an inbuilt Suggester component, which allows you to build suggestion on limited fields.

The following links provide the implementation details -
1. http://lucidworks.lucidimagination.com/display/solr/Suggester
2. http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/

For alternate approaches you can check EdgeNGrams implementation or Terms Component.

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