lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nilesh Bansal" <nileshban...@gmail.com>
Subject Re: RE : indexWriter
Date Fri, 02 Feb 2007 16:07:48 GMT
Hi,

You first need to initialize the directory (since it's empty).
use,
IndexWriter writer = new IndexWriter(indexDir, new StandardAnalyzer(), true);
the first time you are writing.

-Nilesh

On 2/2/07, e.j.w.vanbloem@student.utwente.nl
<e.j.w.vanbloem@student.utwente.nl> wrote:
> I already tried that but does not help
> do I also have to create a file in that dir? Or is it some other problem
>
> import org.apache.lucene.index.IndexWriter;
>
> File indexDir = new File("c:\\temp");
>
> IndexWriter writer = new IndexWriter(indexDir, new StandardAnalyzer(), false);
>
> ________________________________
>
> Van: Virlouvet Olivier [mailto:meils2003@yahoo.fr]
> Verzonden: vr 2-2-2007 16:45
> Aan: java-user@lucene.apache.org
> Onderwerp: RE : indexWriter
>
>
>
> Hi Erik
>
>    The \ must be escaped in the path, i.e : ...new File("c:\\temp");
>
> Regards,
> Olivier
>
> e.j.w.vanbloem@student.utwente.nl a écrit : Hello,
>
> Does anyone know why this does not work?
> The fileDir is of the class File and points to an empty temp directory.
> I tried switching true and false
>
>
> import org.apache.lucene.index.IndexWriter;
>
> File indexDir = new File("c:\temp");
>
> IndexWriter writer = new IndexWriter(indexDir, new StandardAnalyzer(), false);
>
>
> Regards,
>
> Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
>
> ---------------------------------
>  Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez
des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Nilesh Bansal.
http://queens.db.toronto.edu/~nilesh/
Mime
View raw message