예제 #1
0
        public static string GetDocStoreSegment(SegmentInfo si)
        {
            string v = si.GetAttribute(DS_NAME_KEY);

            return(v ?? si.Name);
        }
예제 #2
0
        public static int GetDocStoreOffset(SegmentInfo si)
        {
            string v = si.GetAttribute(DS_OFFSET_KEY);

            return(v == null ? -1 : Convert.ToInt32(v, CultureInfo.InvariantCulture));
        }
예제 #3
0
 private static bool HasSeparateNorms(SegmentInfo info, int number)
 {
     string v = info.GetAttribute(Lucene3xSegmentInfoFormat.NORMGEN_PREFIX + number);
     if (v == null)
     {
         return false;
     }
     else
     {
         Debug.Assert(Convert.ToInt64(v) != SegmentInfo.NO);
         return true;
     }
 }
예제 #4
0
        public static bool GetDocStoreIsCompoundFile(SegmentInfo si)
        {
            string v = si.GetAttribute(DS_COMPOUND_KEY);

            return(v == null ? false : Convert.ToBoolean(v, CultureInfo.InvariantCulture));
        }
예제 #5
0
 private static string GetNormFilename(SegmentInfo info, int number)
 {
     if (HasSeparateNorms(info, number))
     {
         long gen = Convert.ToInt64(info.GetAttribute(Lucene3xSegmentInfoFormat.NORMGEN_PREFIX + number));
         return IndexFileNames.FileNameFromGeneration(info.Name, SEPARATE_NORMS_EXTENSION + number, gen);
     }
     else
     {
         // single file for all norms
         return IndexFileNames.SegmentFileName(info.Name, "", NORMS_EXTENSION);
     }
 }