You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sasank Mudunuri <sa...@gmail.com> on 2010/11/18 08:59:17 UTC

Reading Solr Index directly

Hi,

I've been poking around the JavaDocs a bit, and it looks like it's possible
to directly read the index using the Solr Java API. Hoping to clarify a
couple of things --

1) Do I need to read the index with Solr APIs, or can I use Lucene (PyLucene
is particularly attractive...)? If so, how wary should I be about the Lucene
version number?

2) Is there anything I should worry about in terms of opening a read-only
reader against an active Solr instance? Or will this just block?

3) Anything else that jumps out at gotchas?

I couldn't find any pages about how to do this. I'm happy to compile any
responses for inclusion on the Solr wiki.

thanks!
sasank

Re: Reading Solr Index directly

Posted by Erick Erickson <er...@gmail.com>.
See below:

On Thu, Nov 18, 2010 at 2:59 AM, Sasank Mudunuri <sa...@gmail.com> wrote:

> Hi,
>
> I've been poking around the JavaDocs a bit, and it looks like it's possible
> to directly read the index using the Solr Java API. Hoping to clarify a
> couple of things --
>
> 1) Do I need to read the index with Solr APIs, or can I use Lucene
> (PyLucene
> is particularly attractive...)? If so, how wary should I be about the
> Lucene
> version number?
>
> Shouldn't be any problem to use Lucene (whatever). The only real issue is
that the you have to be sure the analysis chain you use in Lucene matches
the one used to index the data or you'll get surprising results. But that
only
really counts if you're searching.

The version should be OK, the underlying Lucene will barf when you open
a reader if the versions are incompatible.


> 2) Is there anything I should worry about in terms of opening a read-only
> reader against an active Solr instance? Or will this just block?
>
> Any number of r/o searchers can be open against an index, it makes
no difference whether Solr does this or your Lucene app. Simultaneous
writer *processess* are another story (threads within a process are OK).

You won't see *changes* that Solr makes to the index unless you
reopen the underlying readers, there's no magic notification you'll
get either, if you care you'll have to check periodically somehow.


> 3) Anything else that jumps out at gotchas?
>
> Nope. But fair warning, this isn't something I've had to do, I'm replying
based on "general principles" so caveat emptor.


> I couldn't find any pages about how to do this. I'm happy to compile any
> responses for inclusion on the Solr wiki.
>
> thanks!
> sasank
>