简体   繁体   English

如何提高Apache Solr中搜索的排名

[英]How to improve ranking of search in Apache Solr

I am implementing search engine using Apache Solr . 我正在使用Apache Solr实现搜索引擎。 I want to improve results on the basis of most frequent searches. 我想根据最频繁的搜索来改善搜索结果。
For example: Consider my index has 5 words 例如:考虑我的索引有5个字
Down 99 下降99
Drawn 46 拉长46
Dark 86 黑暗86
Dull 75 暗沉75
Dirty 63 脏63
The numbers shows that how many times users searcded a particular word. 数字显示用户搜索特定单词的次数。 I want if a next user comes it and type D the response should be in descending order of previously searched and should be in order 我想如果下一个用户来了,并键入D,则响应应该是以前搜索的降序,并且应该是
Down
Dark
Dull 沉闷
Dirty
Drawn

The results will change from time to time as word searched frequency will change after every search.. How can I implement this in Solr... Any help in this will help me a lot. 结果将不时更改,因为每次搜索后单词搜索的频率都会改变。.我如何在Solr中实现此目的?对此的任何帮助都会对我有很大帮助。
Thanking you in anticipation 感谢你在期待
Regards ASDanyal 关于ASDanyal

As vinod writes, you'll have to keep track of actual searches yourself - there is nothing built-in to Solr to handle this for you. 正如vinod所说,您必须自己跟踪实际搜索-Solr内置没有任何内容可以为您处理。 However, when you DO have the search statistics available, you can implement the feature by having a separate collection / core with searches and their popularity that you search against. 但是,当您确实有可用的搜索统计信息时,可以通过使用一个单独的集合/核心来实现该功能,该集合/核心包含要搜索的搜索及其受欢迎程度。 Each document would be a search term and the frequency of how often that document is searched, ie document: search, search_count. 每个文档将是一个搜索词,以及该文档被搜索的频率,即document:search,search_count。

You can also use a logarithmic function to use the score of a search_count to affect the score of the search terms, for example if you have more than just the search as a field to influence the score (such as active category, etc.). 您还可以使用对数函数来使用search_count的分数来影响搜索字词的分数,例如,如果您不仅仅将搜索作为影响分数的字段(例如,活动类别等),还会使用对数函数。

Depending on search volume, you probably don't need to update these values after each single search - just updating it once a day or every other hour will usually be good enough. 根据搜索量的不同,您可能不需要在每次搜索后更新这些值-每天或每隔一小时更新一次通常就足够了。 Keep track of the terms that have changed in search volume since the last update, and update those documents in a batch job in certain intervals. 跟踪自上次更新以来搜索量发生变化的术语,并以一定间隔更新这些文档。

Solr doesn't provide this kind of feature. Solr不提供这种功能。

One way to achieve this is by using logs, you will need to have an index of search terms entered. 实现此目的的一种方法是使用日志,您需要输入搜索词的索引。 This can be built by mining your search logs. 这可以通过挖掘搜索日志来构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM