EmbeddedSolrServer 的使用现在已经过时了吗?不建议? [英] Is usage of EmbeddedSolrServer now outdated & not recommended?

查看:57
本文介绍了EmbeddedSolrServer 的使用现在已经过时了吗?不建议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要向在 tomcat 上运行的 Java web 应用程序添加搜索功能,以及在同一台机器上的数据库.

I need to add search functionality to my Java webapp running on tomcat, along with the database as well on the same machine.

因为我打算在同一台机器上使用 Solr,但应该使用哪个实现?我认为嵌入式更可取,因为我需要从同一台机器添加数据,所以通过 HTTP 添加没有多大意义,不是吗?&此外,将 Solr 作为单独的 Web 应用程序运行会比嵌入式应用程序消耗更多资源(不是吗?).

Since I'm planning to use Solr on this same machine but which implementation should be used? I thought Embedded one is more preferable since I need to be adding data from the same machine, so adding via HTTP wont make much sense, no? & moreover running Solr as a separate web app would consume more resources than the embedded one(isn't it?).

但是既然不推荐使用EmbeddedSolrServer,那么人们在使用Solr 时如何需要将 Solr 与 webapp 保持在同一台机器上吗?

But now that the use of EmbeddedSolrServer is not recommended, how do people use Solr when they need to keep Solr on the same machine as the webapp ?

推荐答案

您可以在用于 Web 应用程序的同一个 Tomcat 中将 Solr 设置为另一个Web 服务",进行适当的配置并通过 HTTP/休息界面.或者,您也可以使用开箱即用的 Jetty 容器.在此处查看有关如何安装的更多详细信息:http://wiki.apache.org/solr/SolrInstall.

You can setup Solr as another "web service" in the same Tomcat your are using for your web app, do the proper configuration and use it via the HTTP/REST interface. Alternatively you can also use the out-of-the-box Jetty container. Check for more details on how to install here: http://wiki.apache.org/solr/SolrInstall.

我不相信使用嵌入式 solr 会消耗(很多)更少的资源......如果你真的不想分离事物(应用程序和 solr),可能你应该直接查看 Lucene 而不是 Solr,因为Solr 的主要目标是允许为 Lucene 创建 Web 服务接口,它可以从任何应用程序访问(它有几个其他扩展 - http://lucene.apache.org/solr/features.html,但 Solr 的核心是 Lucene java 搜索库.

I do not believe using embedded solr will be consuming (much) less resources... if you really do not want to separate things (application and solr), probably you should be looking on Lucene directly and not Solr, since the main goal of Solr is to allow the creation of web service interface for Lucene, which can be accessed from any application (it has several other extensions - http://lucene.apache.org/solr/features.html, but the core of Solr is the Lucene java search library).

这篇关于EmbeddedSolrServer 的使用现在已经过时了吗?不建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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