コード例 #1
0
        /// <summary>Scans within block for matching term. </summary>
        private TermInfo ScanEnum(Term term)
        {
            SegmentTermEnum enumerator = GetEnum();

            while (term.CompareTo(enumerator.Term()) > 0 && enumerator.Next())
            {
            }
            if (enumerator.Term() != null && term.CompareTo(enumerator.Term()) == 0)
            {
                return(enumerator.TermInfo());
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        private void  ReadIndex()
        {
            SegmentTermEnum indexEnum = new SegmentTermEnum(directory.OpenFile(segment + ".tii"), fieldInfos, true);

            try
            {
                int indexSize = (int)indexEnum.size;

                indexTerms    = new Term[indexSize];
                indexInfos    = new TermInfo[indexSize];
                indexPointers = new long[indexSize];

                for (int i = 0; indexEnum.Next(); i++)
                {
                    indexTerms[i]    = indexEnum.Term();
                    indexInfos[i]    = indexEnum.TermInfo();
                    indexPointers[i] = indexEnum.indexPointer;
                }
            }
            finally
            {
                indexEnum.Close();
            }
        }
コード例 #3
0
ファイル: TermInfosReader.cs プロジェクト: emtees/old-code
		private void  ReadIndex()
		{
			SegmentTermEnum indexEnum = new SegmentTermEnum(directory.OpenFile(segment + ".tii"), fieldInfos, true);
			try
			{
				int indexSize = (int) indexEnum.size;
				
				indexTerms = new Term[indexSize];
				indexInfos = new TermInfo[indexSize];
				indexPointers = new long[indexSize];
				
				for (int i = 0; indexEnum.Next(); i++)
				{
					indexTerms[i] = indexEnum.Term();
					indexInfos[i] = indexEnum.TermInfo();
					indexPointers[i] = indexEnum.indexPointer;
				}
			}
			finally
			{
				indexEnum.Close();
			}
		}