java - 太阳能应该包含在网络应用程序中,还是单独

标签 java tomcat solr

我想使用 solr 向我的 Web 应用程序添加搜索功能。 使用随 SOLR 发行版提供的 WAR 部署 solr 非常简单直接,但我想知道这样做是否有意义?

solr 应该作为单独的 WAR 部署,还是集成到 Web 应用程序中?

总结一下,我有几个问题:

  • 应将 SOLR 作为单独的 WAR 部署或集成到应用程序中。
  • 如果它应该集成到应用程序中,我该如何使用最新的 SOLR 版本呢?我为此找到的所有资源都引用旧版本并依赖已弃用的类。
  • 如果应该单独部署,我应该如何测试我的应用程序?由于 SOLR 必须单独部署,这会使测试变得非常笨拙。

最佳答案

您不应尝试将 Solr 部署为 WAR。

从文档...

https://cwiki.apache.org/confluence/display/solr/Major+Changes+from+Solr+4+to+Solr+5

Beginning with Solr 5.0, Solr is no longer distributed as a "war" (Web Application Archive) suitable for deployment in any Servlet Container. Solr is now distributed as a stand alone java server application, including start and stop scripts for use on Unix and MS-Windows platforms...

...

Internally, Solr is still implemented via Servlet APIs and is powered by Jetty -- but this is simply an implementation detail. Deployment as a "webapp" to other Servlet Containers (or other instances of Jetty) is not supported, and may not work in future 5.x versions of Solr when additional changes are likely to be made to Solr internally to leverage custom networking stack features.

关于java - 太阳能应该包含在网络应用程序中,还是单独,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29283899/

相关文章:

php - Strip_tags() 期望参数 1 为字符串,给定数组

java - 带 spring-test 的 Spring Jar 版本

java - 当几个线程尝试调用同一个同步方法时会发生什么?

java - Tomcat-Maven 401错误

java - Apache Tomcat 7 不接受连接

ruby-on-rails - Sunspot 自动完成插件无法正常工作?

java - Solr:结合 EdgeNGramFilterFactory 和 NGramFilterFactory

java - 如何测试接口(interface) Foo<Bar> 是否是来自 Baz 的 "assignable"?

java - Spring启动测试@WebMethod

java - 如何在运行时从 jar 文件加载类?