Yakob, Here is a snippet of an example of IndexWriter from the lucene source that you might find helpful.
> IndexWriter writer = new IndexWriter(FSDirectory.open(INDEX_DIR), new > StandardAnalyzer(Version.LUCENE_CURRENT), true, > IndexWriter.MaxFieldLength.LIMITED); System.out.println("Indexing to directory '" +INDEX_DIR+ "'..."); indexDocs(writer, docDir); System.out.println("Optimizing..."); writer.optimize(); writer.close(); Seth Rosen www.architexa.com Understand & Document Code In Seconds s...@architexa.com <vin...@architexa.com> 2010/10/27 Yakob <jacob...@opensuse-id.org> > well thanks anyway though. > > On 10/27/10, 蒋明原 <mailtojiangmingy...@gmail.com> wrote: > > you are too lazy.download the lucene source code,take a glance and you > will > > find demos; > > > > On Wed, Oct 27, 2010 at 8:43 PM, Yakob <jacob...@opensuse-id.org> wrote: > > > >> I did searched about this constructor and find that it's already been > >> deprecated. > >> > >> > http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/index/IndexWriter.html#IndexWriter(org.apache.lucene.store.Directory > >> , > >> org.apache.lucene.analysis.Analyzer, boolean) > >> > >> I am using lucene 3.0 now.can I really use this constructor or I > >> should try it first? btw I would appreciate if you gave me a code > >> sample though. thanks. :-) > >> > >> On 10/27/10, 蒋明原 <mailtojiangmingy...@gmail.com> wrote: > >> > IndexWriter writer =new IndexWirter(path,analyzer,false); > >> > > >> > the 3rd parameter is what you want. > >> > than you can > >> > > >> > writer.add(doc) > >> > > >> > enjoy . > >> > > >> > >> -- > >> http://jacobian.web.id > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > >> For additional commands, e-mail: java-user-h...@lucene.apache.org > >> > >> > > > > > -- > http://jacobian.web.id > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >