public static string GetDocStoreSegment(SegmentInfo si) { string v = si.GetAttribute(DS_NAME_KEY); return(v ?? si.Name); }
public static int GetDocStoreOffset(SegmentInfo si) { string v = si.GetAttribute(DS_OFFSET_KEY); return(v == null ? -1 : Convert.ToInt32(v, CultureInfo.InvariantCulture)); }
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; } }
public static bool GetDocStoreIsCompoundFile(SegmentInfo si) { string v = si.GetAttribute(DS_COMPOUND_KEY); return(v == null ? false : Convert.ToBoolean(v, CultureInfo.InvariantCulture)); }
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); } }