Calculate byte offset of each hit (for plain text files only)
The easiest way to highlight hits in files retrieved with the dtSearch Engine is to use a FileConverter to convert the retrieved file to an HTML document with the hits highlighted. For plain text files, the dtSearch Engine provides an alternative method. Instead of highlighting the hits directly, the Engine can provide a map of the hits in each file. The map contains, for each hit, the byte offset in the file, the word offset, the page number, and the paragraph number.
The map is expressed as a string consisting of a series of entries delimited with the ";" character. The entries are formatted as follows:
GetHitByteOffsets produces meaningful results only for plain text files. For other file types, including HTML or RTF, GetHitByteOffsets will not work.