Class
ReaderChunkSearchIndex
OfficeIMO.Reader
In-memory BM25 index over ReaderChunk values: chunk text as the body and the heading path as a weighted heading field. Queries accept words, "quoted phrases", prefix*, AND, OR and parentheses.
Inheritance
- object
- ReaderChunkSearchIndex
Remarks
Words are found with Unicode (UAX #29) word boundaries, normalized to NFKC and case folded. Equal scores rank in the order the chunks were given. Build the index once and search it as often as needed; it keeps references to the chunks, not copies.
Constructors
public ReaderChunkSearchIndex(IEnumerable<ReaderChunk> chunks, OfficeDocumentRankingOptions? ranking = null) #Indexes chunks in order.
Parameters
- chunks System.Collections.Generic.IEnumerable<OfficeIMO.Reader.ReaderChunk>
- ranking OfficeIMO.Reader.OfficeDocumentRankingOptions? = null
Methods
public ReaderChunkSearchResult Search(string query, int maximumResults = 100) #Returns up to maximumResults chunks, best first.
Parameters
- query string
- maximumResults int = 100
Returns
ReaderChunkSearchResultInherited Methods
Properties
public bool LimitReached { get; } #True when OfficeDocumentRankingOptions.MaximumIndexedTokens cut indexing short.