lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject .sN (separate norms files) and NO_NORMS
Date Tue, 09 Jan 2007 07:36:46 GMT
Hi,

I recently run the FieldNormModifier (see http://issues.apache.org/jira/browse/LUCENE-741
) on 8 fields that I wanted to turn into NO_NORMS fields.  I run this on several optimized
.cfs indices.  Afterwards I noticed that *some* (but not all!) indices contained 8 .sN (where
N is a number) files.  Those are norm files, I believe (Lucene 2.0.0).  Meanwhile, the .cfs
file remained untouched.  Does anyone know how to explain this?

What bugs me is:
- Why was the original .cfs not modified?
- Why did .sN files show up separately?

What bugs my colleague (hi Brian!) is:
- Why are there separate norms for each NO_NORMS field, and not just 1 for all of them?
(my answer is that the files still exists like they exist for non-NO_NORMS fields, it's just
that they are full of 1.0s, but I'm not absolutely sure that's the correct answer.)

I would have expected the .cfs file to get modified.  Or I'd expect to see 8 .sN files along
the unmodified .cfs in *all* index directories I run this against, and not just some.

The essential, index-modifying part of FieldNormModifier is this:

      reader = IndexReader.open(dir);
      for (int d = 0; d < termCounts.length; d++) {
        if (! reader.isDeleted(d)) {
          if (sim == null)
            reader.setNorm(d, fieldName, fakeNorms[0]);        // this is my case - turning
existing fields into Field.NO_NORMS fields.
          else
            reader.setNorm(d, fieldName, sim.encodeNorm(sim.lengthNorm(fieldName, termCounts[d])));
        }
      }

Also, looking at http://lucene.apache.org/java/docs/fileformats.html I don't even see any
mention of .sN files.

Does anyone has an explanation for this before I start digging? 

Thanks,
Otis




---------------------------------------------------------------------
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