예제 #1
0
 internal override void  Finish()
 {
     System.Diagnostics.Debug.Assert(docIDs.Length == norms.Length);
     if (fieldInfo.isIndexed && !fieldInfo.omitNorms)
     {
         if (docIDs.Length <= upto)
         {
             System.Diagnostics.Debug.Assert(docIDs.Length == upto);
             docIDs = ArrayUtil.Grow(docIDs, 1 + upto);
             norms  = ArrayUtil.Grow(norms, 1 + upto);
         }
         float norm = docState.similarity.ComputeNorm(fieldInfo.name, fieldState);
         norms[upto]  = Similarity.EncodeNorm(norm);
         docIDs[upto] = docState.docID;
         upto++;
     }
 }
예제 #2
0
 static NormsWriter()
 {
     defaultNorm = Similarity.EncodeNorm(1.0f);
 }