Hi,
I agree. I wrote a custom class and it actually works in the 1, 3, 2 order
below. I changed FieldInfos to non-final, but I think that's it.
Actually, my class doesn't do 1 yet. This used to work:
// unpack cfs
writer = new IndexWriter("/tmp/fnm", new SimpleAnalyzer(), false);
writer.setUseCompoundFile(false);
writer.optimize();
writer.close();
But this doesn't seem to work any more. I think now one has to modify the
index ... holllly, nice conditional in optimize()! :)
Would adding forceOptimize() to IndexWriter be a good thing?
public synchronized void forceOptimize() throws IOException {
flushRamSegments();
int minSegment = segmentInfos.size() - mergeFactor;
mergeSegments(minSegment < 0 ? 0 : minSegment);
}
Then the above cfs unpacking with writer.forceOptimize() call works.
Otis
----- Original Message ----
From: Yonik Seeley <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, January 9, 2007 8:33:09 PM
Subject: Re: .sN (separate norms files) and NO_NORMS
On 1/9/07, Otis Gospodnetic <[EMAIL PROTECTED]> wrote:
> Couldn't one convert a non NO_NORMS field to a genuine NO_NORMS field by:
> 1. expanding an index to a multi-file index (if the index was a .cfs one)
> 2. removing the appropriate .fN file from the index directory
> 3. switching that omitNorms bit in FieldInfo
Yes, that would work for some custom code. Step (2) might even be
done for you if you do step 3 first and then do an optimize.
This stuff seems more like the exception than the norm :-) though, so
I think it might not be worth the burden of supporting it in the
public API.
-Yonik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]