C# Class BzReader.Indexer

Show file Open project: synhershko/BzReader Class Usage Examples

Public Methods

Method Description
AbortIndex ( ) : void
Close ( ) : void

Closes the searcher object

CreateIndex ( ) : void
Indexer ( string path ) : System

Initializes a new instance of the Indexer class.

LoadAndDecodeBlock ( long begin, long end ) : string

Loads a block from the file, decompresses it and decodes to string

Search ( string queryString, IEnumerable indexers, int maxResults ) : HitCollection

Searches for the specified term in the index.

Protected Methods

Method Description
OnProgressChanged ( ProgressChangedEventArgs e ) : void

Private Methods

Method Description
BzipBlockLocatorProgressMonitor ( ) : void

watch the bzip2 block locator and report progress

CreateIndexAsync ( ) : void

Creates the index for the bz2 file on a separate thread.

GuessAnalyzer ( string filePath, bool &isRTL ) : Analyzer
IndexString ( string currentText, long beginning, long end, int charCarryOver, bool lastBlock ) : int

Indexes the provided string

LoadBlock ( long beginning, long end, byte &buf ) : long

Loads the bzip2 block from the file

LocateBlocks ( ) : void

Locates the bzip2 blocks in the file

ReportProgress ( int percentage, IndexingProgress status, string message ) : void
Search ( object state ) : void

The searches are always executed on the thread pools

TokenizeAndAdd ( object state ) : void

Tokenizes and adds the specified PageInfo object to Lucene index

Method Details

AbortIndex() public method

public AbortIndex ( ) : void
return void

Close() public method

Closes the searcher object
public Close ( ) : void
return void

CreateIndex() public method

public CreateIndex ( ) : void
return void

Indexer() public method

Initializes a new instance of the Indexer class.
public Indexer ( string path ) : System
path string The path to the .xml.bz2 dump of wikipedia
return System

LoadAndDecodeBlock() public method

Loads a block from the file, decompresses it and decodes to string
public LoadAndDecodeBlock ( long begin, long end ) : string
begin long The list of block beginnings
end long The list of block ends
return string

OnProgressChanged() protected method

protected OnProgressChanged ( ProgressChangedEventArgs e ) : void
e System.ComponentModel.ProgressChangedEventArgs
return void

Search() public static method

Searches for the specified term in the index.
public static Search ( string queryString, IEnumerable indexers, int maxResults ) : HitCollection
queryString string
indexers IEnumerable
maxResults int
return HitCollection