How to implement "next hit" and "previous hit" navigation features.
In addition to highlighting hits, it is often helpful to enable users to quickly jump from hit to hit using "Next Hit" and "Prev Hit" buttons in your user interface. The dtSearch Engine's hit highlighting API supports this feature by providing a way to number the "BeforeHit" and "AfterHit" markings.
When the BeforeHit and AfterHit marks are inserted, the strings "%%ThisHit%%", "%%NextHit%%", and "%%PrevHit%%" will be replaced with ordinals representing the current hit, the next hit, and the previous hit in the document. For example, the following code makes the beforeHit and nextHit marks act as HTML "Previous Hit" and "Next Hit" buttons.
Sequential integers are used to identify each hit except for the last, which is named _last. For example, if BeforeHit = "xxx%%ThisHit%%", then "xxx1" would appear before the first hit, "xxx2" before the second hit, and so forth, with "xxx_last" in front of the last hit.