使用Java进行Solr定制以获取修改后的输出? [英] Solr Customization using Java for modified output?

查看:69
本文介绍了使用Java进行Solr定制以获取修改后的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Solr开发应用程序.一切都很好,我期待将Solr与CodeIgniter或其他前端框架集成在一起.但有一个问题.我正在对Solr抛出的输出行进行一些计算,并将其显示给用户.用PHP确实是不可行的(因为这需要很长时间).我有一个用Java编写的现有代码,因此,我没有理由将此应用程序移植到PHP.我怎样才能做到这一点?无论如何,我可以在某个查询中插入Java代码来修改输出吗?请注意,我正在执行的操作仅针对Solr结果,因此必须获得结果,然后对其进行操作.请建议我该怎么做?

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?

推荐答案

如果我了解您正在使用PHP开发前端,但想重用Java代码来处理将在前端显示的solr结果,...大概有两种方法可以解决:

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. 创建简单的Java"Web服务",用于处理Solr结果并将其提供给PHP前端(因此,PHP应用程序需要调用Java Web服务,其中包含您所引用的代码)...为此您可以使用类似以下内容的方法:Jersey( https://jersey.java.net/)创建一个Java网站服务.
  2. (如果是用PHP编写Web应用程序,则可能是最好的选择),您应该详细了解Solr PHP客户端( http://wiki.apache.org/solr/SolPHP ).
  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).

这篇关于使用Java进行Solr定制以获取修改后的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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