DTSEARCHHIGHLIGHT(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

okay bestie, this is the DtSearchHighlight page from the library call manual β€” buckle up, it’s giving β€œhighlight the words in your doc” energy πŸ’…βœ¨

πŸ’– NAME πŸ’–

DtSearchHighlight β€” generate a DtSrHitwords table for highlighting a DtSearch document πŸŽ€

✨ SYNOPSIS ✨

#include &<Dt/Search.h>
intDtSearchHighlight(
char *dbname,
char *cleartext,
DtSrHitword **hitwptr,
long *hitwcount,
int search_type,
char *stems,
int stemcount);

🫢 DESCRIPTION 🫢

The DtSearchHighlight function generates an array of offsets and lengths (DtSrHitword) of parsed linguistic terms (stems) in the passed document cleartext to enable a browser to highlight the words in the text as appropriate for its user interface. No cap, that’s the whole glow-up πŸ’–

πŸŽ€ ARGUMENTS πŸŽ€

  • dbname β€” tells you which database is to be searched, bestie. It is any one of the database name strings returned from DtSearchInit or DtSearchReinit. If dbname is NULL, the first database name string is used. Periodt πŸ’…
  • cleartext β€” pointer to a zero terminated C string containing the document text to be highlighted. Usually, but not necessarily, this value is returned from DtSearchRetrieve. πŸ¦‹
  • hitwptr and hitwcount β€” the hitwords array will be stored in hitwptr, the address of a DtSrHitword pointer. The array is dynamically allocated by this function and remains valid until the next call to this function. The size of the hitwords array will be stored in hitwcount. πŸ‘‘
  • search_type β€” specifies the search_type of the DtSearchQuery that generated the stems array. It must be zero, 'P', 'W', or 'S'. If zero is passed, the search_type of the last call to DtSearchQuery is assumed. πŸ”₯
  • stems and stemcount β€” these are optional; they can be NULL and zero respectively. However, if either is specified, both must be specified. If specified, they refer to the stems array that was returned from the previous call to DtSearchQuery that ultimately resulted in the cleartext argument. If these arguments are not passed, the stems array from the most recent call to DtSearchQuery is assumed. 🌸
bestie PSA: stems and stemcount are a package deal β€” if either is specified, both must be specified 🫢

🌈 RETURN VALUE 🌈

This function returns DtSrOK, as well as a DtSrHitword table, when the table generation is completely successful. Slay βœ…

Any other return code signifies failure and user messages on the MessageList explain why. πŸ‘€

Any API function can also return DtSrREINIT and the return codes for fatal engine errors at any time. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹


β€” πŸŽ€ cute sign-off, bestie: this is the DtSearchHighlight (library call) page; the footer had no separate source/version/date line beyond that, so no extra metadata to spill πŸ’–

πŸ“¦ where this page comes from