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 Ramprakash Ramamoorthy <yo...@gmail.com> on 2012/06/07 09:48:07 UTC

Porting from Solr 1.3 to 3.5

I am porting my app from lucene 2.X(solr 1.3) to lucene 3.X(solr 3.5). The
following is my issue.

This one was valid in 2.X, but 3.5 throws me an error.

IndexReader reader = IndexReader.open("/home/path/to/my/dataDir");

2.X accepted a string, but 3.5 strictly wants a Directory object. I find
Directory to be abstract and the only way to instantiate it seems a
RAMDirectory().

How do I go about this and how do I point my reader to the desired
directory?


P.S : Our application needs a custom logic this way and hence instead of
going with cores, we do it this way.

-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
Engineer Trainee,
Zoho Corporation.
+91 9626975420

Re: Porting from Solr 1.3 to 3.5

Posted by Ramprakash Ramamoorthy <yo...@gmail.com>.
On Thu, Jun 7, 2012 at 1:18 PM, Ramprakash Ramamoorthy <
youngestachiever@gmail.com> wrote:

> I am porting my app from lucene 2.X(solr 1.3) to lucene 3.X(solr 3.5). The
> following is my issue.
>
> This one was valid in 2.X, but 3.5 throws me an error.
>
> IndexReader reader = IndexReader.open("/home/path/to/my/dataDir");
>
> 2.X accepted a string, but 3.5 strictly wants a Directory object. I find
> Directory to be abstract and the only way to instantiate it seems a
> RAMDirectory().
>
> How do I go about this and how do I point my reader to the desired
> directory?
>
>
> P.S : Our application needs a custom logic this way and hence instead of
> going with cores, we do it this way.
>
> --
> With Thanks and Regards,
> Ramprakash Ramamoorthy,
> Engineer Trainee,
> Zoho Corporation.
> +91 9626975420
>
>
I was able to do it. I just did it this way

IndexReader reader = new SimpleFSDirectory(new File("my/desired/path"));

Thanks for your time.

-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
Engineer Trainee,
Zoho Corporation.
+91 9626975420