/// <summary> /// Standardowy konstruktor /// </summary> /// <param name="sharedData">Dane współdzielone z indekserem IxStdRIIndexer i pozostałymi wątkami</param> /// <param name="indexWriter">Cel zapisu indeksu dla wątku, musi być thread-safe albo dedykowany</param> /// <param name="finishedEvent">Zdarzenie zakończenia pracy (niesygnalizowane)</param> public IxStdRIIndexerThread(IxStdRIIndexerSharedData sharedData, Index.IIxIndexWriter indexWriter, ManualResetEvent finishedEvent) { this.sharedData = sharedData; this.indexWriter = indexWriter; this.finishedEvent = finishedEvent; this.textTokensListing = new IxTokenizer(sharedData.dictionary); this.titleTokensListing = new IxTokenizer(sharedData.dictionary); }
/// <summary> /// Standardowy konstruktor /// </summary> /// <param name="workingDir">Katalog z danymi indeksu</param> public IxStdRISearchEngine(string workingDir) { workingDir = Misc.provideEndBackslash(workingDir); invIndex = new IxStdDiskRIIndex(workingDir + "invIndex", IxIndexMode.READ); documentsIndex = new IxStdDiskDocumentsIndex(workingDir + "documents", DocumentsIndexMode.READ); fwdDict = new IxFwdDistDiskDict(workingDir + "fwdDict", IxDictionaryMode.READ, null); tokenListing = new IxTokenizer(fwdDict); documentsCount = (double)invIndex.getDocumentsCount(); }
public uint allocateIdForDocument(IxDocument document, IxTokenizer documentTokenizer) { uint documentId; lock (nextDocumentId) { /* Pobierz ID dla dokumentu */ documentId = nextDocumentId.value++; /* Dodaj dokument do indeksu dokumentów */ documentsIndex.addDocument(document, documentId); /* Dodaj spis tokenów do indeksu wprzód (jeśli tworzony) */ if (IxSettings.createFwdIndex) fwdIndex.addDocumentTokenList(documentTokenizer.getEncounteredTokens()); } return documentId; }
public IxTokenPositionBasedRank(string pathToIndexLocation) { _fwdDict = new IxFwdDistDiskDict(pathToIndexLocation + @"\fwdDict", IxDictionaryMode.READ, null);//tworzymy słownik wprzód, żeby na podstawie wartości tokena pobrać jego id _tokenPosIndex = new IxTokenPositionsIndex(pathToIndexLocation); _tokenizer = new IxTokenizer(_fwdDict); }
/// <summary> /// Standardowy konstruktor /// </summary> /// <param name="workingDir">Katalog z danymi indeksu</param> public IxHALIRSearchEngine(string workingDir) { workingDir = Misc.provideEndBackslash(workingDir); this.workingDir = workingDir; invIndex = new IxStdDiskRIIndex(workingDir + "invIndex", IxIndexMode.READ); fwdIndex = new IxStdDiskFwdIndex(workingDir + "fwdIndex", IxIndexMode.READ); documentsIndex = new IxStdDiskDocumentsIndex(workingDir + "documents", DocumentsIndexMode.READ); fwdDictionary = new IxFwdDistDiskDict(workingDir + "fwdDict", IxDictionaryMode.READ, null); bkdDictionary = new IxStdBkdDiskDict(workingDir + "bkdDict", IxDictionaryMode.READ); tokenListing = new IxTokenizer(fwdDictionary); halContextObtainer = new IxHalContextObtainer(workingDir + "hal", fwdIndex, invIndex); documentsCount = (double)invIndex.getDocumentsCount(); }