On May 16, 2019, at 1:25 PM, Eric Lease Morgan <[log in to unmask]> wrote:
>
> Is it possible to create a Solr index, copy the file(s) to my local machine, and query the index sans the Solr server?
That's a bit tricky, but possible. It's a Lucene index, which is just a directory of binary files. The trick to querying it, sans Solr, will be to write Java code using the Lucene API - and to synchronize your analysis/tokenization with how it was indexed. That last part is the challenge since you'll have a Solr schema (in schema.xml or managed-schema) that won't be useful in a pure Lucene API using app.
There is one other option above using the lower level Lucene API, and that's to use Solr's EmbeddedSolrServer, which is a Java API that launches an in-process "Solr" (but not over HTTP, just in process Java API) - that will allow you to leverage the Solr schema and everything else just like it was Solr over the wire.
Personally, I'd fire up a real Solr server locally with the Solr configuration and use localhost - which will be the easiest way to get a foreign Solr collection running locally.
> SQLite works like that. There is no server. I can use SQLite to create a file, copy the file to a different computer (even a different operating system), and use a SQLite client on the different machine. In fact, there are bunches o' API's I can use to query the SQLite file.
Yeah, that's equivalent Solr's EmbeddedSolrServer API. But does require writing Java (or JVM, like say JRuby!) code to leverage it. [I could imagine a Solr feature request that makes a simpler client, but it'd probably get pushback saying "just use Solr over HTTP locally"]
> Solr is a great indexer, IMHO, but if I were able to copy the index file locally, and query it without the server, then I think Solr would be even greater.
Or query it remotely?
Erik
|