Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access the admin interface of an EmbeddedSolrServer instance?

Tags:

java

solrj

In my web app I am running an org.apache.solr.client.solrj.embedded.EmbeddedSolrServer for debugging purposes I would like to access the admin interface.

This is how I instantiate the server:

new EmbeddedSolrServer(new CoreContainer.Initializer().initialize(), "");           

Is there a way to open the admin interface of this embedded server like so?

http://localhost:<defaultport>/admin

If so which port would I have to use (what is the default port)?

Else is there a setting that I use to specify the web path for accessing the admin UI?

like image 958
zsawyer Avatar asked Jun 04 '13 15:06

zsawyer


People also ask

How do I access Solr Admin UI?

The path to the Solr Admin UI given above is http://hostname:port/solr , which redirects to http://hostname:port/solr/#/ in the current version. A convenience redirect is also supported, so simply accessing the Admin UI at http://hostname:port/ will also redirect to http://hostname:port/solr/#/ .

How do I query Solr admin?

You can search for "solr" by loading the Admin UI Query tab, enter "solr" in the q param (replacing *:* , which matches all documents), and "Execute Query". See the Searching section below for more information. To index your own data, re-run the directory indexing command pointed to your own directory of documents.

How do I access Solr dashboard?

Dashboard. Accessing the URL http://hostname:8983/solr/ will show the main dashboard, which is divided into two parts. The left-side of the screen is a menu under the Solr logo that provides the navigation through the screens of the UI.


1 Answers

No, there isn't. At least, not while your application is running.

The embedded solr server reads and writes the index directly on your filesystem in your solr install directory. To access the admin console, shut down your app. In a console navigate to your /example in your solr install directory. Type java -jar start.jar. Then, you can navigate to http://localhost:8983/solr to access the admin directory.

You can not have your solr server running and be running an application that accesses the same index via EmbeddedSolrServer or you will get a LockObtainFailedException. Solr only allows one reader/writer per index at a time, and that reader/writer obtains a 'lock' in order to access the index. This prevents the index from becoming corrupted from multiple simultaneous reads/writes.

For that reason, I prefer to use the HttpSolrServer instead of the EmbeddedSolrServer, even for a development environment.

See: http://wiki.apache.org/solr/Solrj#EmbeddedSolrServer

like image 121
Mike Nitchie Avatar answered Sep 18 '22 20:09

Mike Nitchie