Solr Customization using Java for modified output?

蹲街弑〆低调 提交于 2019-12-25 10:30:28

问题


I am developing an application uaing Solr. Everything is going fine and I am looking ahead to integrate Solr with CodeIgniter or some other framework for frontend. But there is a problem. I am performing some calculations on output rows thrown by Solr and showing them to users. It is really not feasible to do in PHP ( as it takes really long time). I have an existing code written in Java and hence, I find no reason in porting this application to PHP. How can I do that? Is there anyway I can insert my Java code on a certain query to modify output? Please note, operations I am performing are on Solr results only, so getting results is a must and then operations on them. Please suggest me how can I do that?


回答1:


If I understand you are developing a Front-end in PHP but want to reuse Java code to handle solr results to be presented on your front-end... Probably you have two ways to go:

  1. Crete simple Java "web service" that processes your Solr results and give them to your PHP front-end (so the PHP application needs to call the Java web service, that has the code you refer to)... for that you could use something like: Jersey (https://jersey.java.net/) to create a java web service.
  2. (probably the best one, if you are writing your Web applicaiton in PHP) you should look in more detail on Solr PHP clients (http://wiki.apache.org/solr/SolPHP).


来源:https://stackoverflow.com/questions/17781609/solr-customization-using-java-for-modified-output

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