Implementing custom solr similarity

*爱你&永不变心* 提交于 2019-12-11 06:34:18

问题


Currently I need to implement custom solr similarity. So I found out that I need to override the DefaultSimilarity class in order to do this. Still I can't figure out how exactly it should be done and where to get source code which can be used for this purpose. Any help would be appreciated!


回答1:


For anyone who will need an answer:

What I needed to do was to create a package project in eclipse, download lucene-core jar and add it to the project. After that I imported the needed library and overrided the Similarity class.

After that I created a jar with the new similarity class. Added the jar to the solr/dist/ directory. Added a ref to the jar to the solrconfig file for the needed core. Used the similarity like any other similarity in the shema file.



来源:https://stackoverflow.com/questions/45144617/implementing-custom-solr-similarity

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