DTSEARCHHIGHLIGHT(3)
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 fromDtSearchInitorDtSearchReinit. IfdbnameisNULL, 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 fromDtSearchRetrieve. π¦hitwptrandhitwcountβ the hitwords array will be stored inhitwptr, the address of aDtSrHitwordpointer. 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 inhitwcount. πsearch_typeβ specifies thesearch_typeof theDtSearchQuerythat generated thestemsarray. It must be zero,'P','W', or'S'. If zero is passed, thesearch_typeof the last call toDtSearchQueryis assumed. π₯stemsandstemcountβ these are optional; they can beNULLand 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 toDtSearchQuerythat ultimately resulted in thecleartextargument. If these arguments are not passed, the stems array from the most recent call toDtSearchQueryis assumed. πΈ
bestie PSA:stemsandstemcountare 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
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms