在Apache Solr实现文件的要求计 [英] request counting for documents in apache solr

查看:135
本文介绍了在Apache Solr实现文件的要求计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的网站正在使用Apache Solr实现特定文档的请求。现在,我都数不过来的请求提供服务的每个文件的总数。我知道我必须使用一些数据库用于此目的。但我不知道如何将文档投放时飞即更新文档数据库。我已经使用谛导入文件从MySQL到Solr的。
我该怎么做了。


解决方案

请具体谈谈您的用例。

我会回答这个问题:
我应该怎么做来计算所有交付的文件和使用的计数来改变我的文档的排名?


  1. 每个文档计数(-ID)

如果你真的不能做你的应用程序比内生成自己的<一个href=\"https://cwiki.apache.org/confluence/display/solr/RequestHandlers+and+SearchComponents+in+SolrConfig#RequestHandlersandSearchComponentsinSolrConfig-SearchComponents\"相对=nofollow>的SearchComponent 从结果-文档集收集文档的IDS。使用<一个href=\"http://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_5_4_0/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java\"相对=nofollow> StatsComponent 为出发点。

<醇开始=2>
  • 使用每个文件的动态计数排名

  • 更新一个solr的文档是昂贵的。因此,使用 ExternalFileField
    外部文件场Apache Solr实现

    I have a simple website that is using apache solr for request of specific documents. Now I have to count the total number of request for each document served. I know that I have to use some database for this purpose. But I do not know how to update documents in database on fly i.e. when documents are served. I have used DIH to import documents from mysql to solr. How do I do it.

    解决方案

    please be more specific about your use-case.

    I will answer for this question: What should I do to count all delivered documents and use the count to change the ranking of my documents?

    1. Count per document(-ID)

    If you really can not do this inside your application than generate your own SearchComponent to collect the document-Ids from the result-DocSet. Use StatsComponent as starting point.

    1. Use a dynamic count per document for ranking

    Updating a solr-document is expensive. So use ExternalFileField: External File Field in Apache Solr

    这篇关于在Apache Solr实现文件的要求计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆