request counting for documents in apache solr

蓝咒 提交于 2019-12-22 01:20:38

问题


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.


回答1:


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




回答2:


You can use Schema browser to view frequency of search in solr.

You can view on every field.

Histogram represents top searches and their frequency for terms.

But to update you need your own search component that updates count in database.



来源:https://stackoverflow.com/questions/34715990/request-counting-for-documents-in-apache-solr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!