Is usage of EmbeddedSolrServer now outdated & not recommended?
Asked Answered
D

3

3

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

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?).

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 ?

Dismuke answered 1/10, 2013 at 7:6 Comment(0)
I
2

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.

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).

Incline answered 1/10, 2013 at 7:22 Comment(0)
D
1

The page you reference answers your question. You run Solr on the same machine in its own JVM, as a service, and interact with it over HTTP (to localhost).

Delgado answered 1/10, 2013 at 7:9 Comment(2)
"run Solr on the same machine in its own JVM.." - shouldn't I be moving it to Tomcat when it's already running so as to prevent unnecessary resource consumption ?Dismuke
you can place Solr in the same Tomcat of your web app, no problem.Incline
E
0

This question/answers are very old and the op is referring a page that cames from the OLD WIKI. At time of writing EmbeddedSolrServer is tipically recommended for TEST usage, and not for production.

Infact EmbeddedSolrServer is widely used in many tests of the Solr codebase.

Recently I noticed that there aren't clear instruction, even in the solr documentation, that explain how to use it. So I wrote a Java example that helps to write your own test configuration, load data and run junit unit tests.

https://github.com/freedev/EmbeddedSolrServer-junit-example

Electret answered 21/1, 2021 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.