internal InvertedIndex(string path, string fieldName, Data.Field.IndexMode mode, bool rebuild, Data.DBProvider dbProvider, int documnetCount) { _FieldName = fieldName; _IndexMode = mode; _DBProvider = dbProvider; InitFileStore(path, fieldName, rebuild); //Cache.CacheManager.Register(this); _IndexMerge = new IndexMerge(path, _IndexFileProxy); _DocumentCount = documnetCount; //InitCollectThread(); }
//internal IEnumerable<DocumentPositionList> GetDocListForWriter1() //{ // int j = 0; // foreach (DocumentPositionList docPositionList in GetDocListForWriter1()) // { // if (docPositionList.DocumentId != _ListForWriter[j].DocumentId || // docPositionList.Count != _ListForWriter[j].Count || // docPositionList.FirstPosition != _ListForWriter[j].FirstPosition || // docPositionList.TotalWordsInThisDocument != _ListForWriter[j].TotalWordsInThisDocument) // { // Console.WriteLine(); // } // j++; // } // for (int i = 0; i < _ListForWriter.Count; i++) // { // yield return _ListForWriter[i]; // } //} internal WordIndexWriter(string word, Data.Field.IndexMode mode, DocumentPositionAlloc alloc) { _Word = word; _IndexMode = mode; _DocPositionAlloc = alloc; _Count = 0; TempDocId = 0; TempFirstPosition = 0; TempWordCountInThisDoc = 0; //How many words (this word) in this doc TempTotalWordsInDoc = 0; //Total words in this doc //_ListForWriter = new List<DocumentPositionList>(); _First = -1; _Cur = -1; }