lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: IndexWriterConfig.OpenMode.CREATE vs OpenMode.APPEND (index files)
Date Thu, 31 Jan 2013 18:57:46 GMT
I don't know what _0.csi is ... was that supposed to be _0.si?

Did you pass create=true or false for the 2nd update?

Mike McCandless

http://blog.mikemccandless.com

On Thu, Jan 31, 2013 at 1:39 PM, saisantoshi <saisantoshi76@gmail.com> wrote:
> I am using the following below for creating the IndexWriter (for my
> indexing):
>
> IndexWriterConfig indexWriterConfig = new
> IndexWriterConfig(Version.LUCENE_40,
>                 new LimitTokenCountAnalyzer(analyzer,
> MAX_FIELD_SCAN_LENGTH));
>
> if (create) {  // create will be trure for indexing first time and later
> will be false for updating the existing index
>                 indexWriterConfig.setOpenMode(OpenMode.CREATE);
>         } else {
>             indexWriterConfig.setOpenMode(OpenMode.APPEND);
>   }
>         TieredMergePolicy mergePolicy = new TieredMergePolicy();
>         indexWriterConfig.setMergePolicy(mergePolicy.setNoCFSRatio(1.0d));
>          IndexWriter indexWriter = new IndexWriter(directory,
> indexWriterConfig);
>
> For creating the first time, index it is creating the following files:
>
> _0.cfe
> _0.cfs
> _0.csi
> segments.gen
> segments_1
>
> on subsequent updates, it is creating additional files like the below:
>
> _0.cfe
> _0.cfs
> _0.csi
> _1.cfe
> _1.cfs
> _1.csi
> _0_1.del
> _2.cfe
> _2.cfs
> _2.csi
> segments.gen
> segments_3
>
> I am assuming that it should override the files initially created for
> indexing:
>
> should have just the following below files:
>
> _2.cfe
> _2.cfs
> _2.csi
> segments.gen
> segments_3
>
> Can someone please let me know if this is intended behavior or something
> wrong with the way I am creating the IndexWriterConfig.
>
> Appreciate if you could shed some light on this as the docs are not very
> clear.
>
> Thanks,
> Sai.
>
>
>
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/IndexWriterConfig-OpenMode-CREATE-vs-OpenMode-APPEND-index-files-tp4037766.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message