private static void PushTermOnStack(string term, TermIndexAccessor index, Stack opStack) { if (!FullTextIndexer.isValuableToken(term)) { opStack.Push(new StopwordTerm()); if (Stopwords.IndexOf(term) == -1) { Stopwords.Add(term); } } else { TermIndexRecord record = index.GetRecord(term); if (record != null) { int order = Lexemes.IndexOf(term); if (order == -1) { Lexemes.Add(term); order = Lexemes.Count - 1; } record.PopulateRecordID((ushort)order); } opStack.Push(record); } }
protected void LoadOffsetsFromIndex() { foreach (int handle in _indexFile.GetAllFiles(false)) { if (Core.State == CoreState.ShuttingDown) { break; } if (handle != HandleOfHeaderFile) { TermIndexRecord record = GetRecordByHandle(handle); recordKey.SetIntKey(record.HC); TermId2RecordHandle.InsertKey(recordKey, handle); } } if (Core.State == CoreState.ShuttingDown) { TermId2RecordHandle.Clear(); } }