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?
- 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.
- 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.