lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jm <jmugur...@gmail.com>
Subject Re: indexing data without writing to disk ?
Date Fri, 01 Apr 2011 11:33:09 GMT
or maybe MemoryIndex  (in contrib) is more suited to what he wants

On Fri, Apr 1, 2011 at 1:10 PM, Ian Lea <ian.lea@gmail.com> wrote:

> RAMDirectory.  The clue is in the name ...
>
>
> --
> Ian.
>
>
> On Fri, Apr 1, 2011 at 11:08 AM, Patrick Diviacco
> <patrick.diviacco@gmail.com> wrote:
> > Is there a way to index data into memory without writing to disk in
> Lucene ?
> >
> > This is my current code storing it on disk
> >
> > writer = new IndexWriter(FSDirectory.open(index_dir), new
> > IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_40, new
> > WhitespaceAnalyzer(org.apache.lucene.util.Version.LUCENE_40)));
> >
> > //store sorted content to contents
> > Iterator<Map.Entry<String,Cluster>> it = clusters.entrySet().iterator();
> >
> > while (it.hasNext()) {
> >
> > ...
> > Document document  = new Document();
> >                document.add(new Field("id", id, Field.Store.YES,
> > Field.Index.ANALYZED));
> >               writer.addDocument(document);
> > }
> > writer.optimize();
> > writer.close();
> >
> >
> > thanks
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message