Highlighting

The module enables you to highlight the occurrences of a clue in search results. Highlighting is the process of retrieving the location of every instance of a clue in the search text.

You can use the etx_GetHilite() routine in the SELECT list of a query to return highlighting information from a text search, as shown in the following example:
SELECT etx_GetHilite (description, rc) FROM videos
    WHERE etx_contains(description, 
    'multimedia',  rc # etx_ReturnType);
This query returns all documents that contain the keyword multimedia in the description column of the table videos. In addition, for each row returned, the query also returns etx_HiliteType values that contain information about the location of every instance of the word multimedia in the corresponding document.
Important: If you use the etx_GetHilite() function in a query that returns more than one row, the function executes once for each row. This means that each row has its own highlighting information, contained in the etx_HiliteType row data type returned by the etx_GetHilite() function. This highlighting information pertains only to the document contained in the row, not to any other document.

The etx_HiliteType row data type consists of two fields: vec_offset and viewer_doc. The vec_offset field contains pairs of integers that describe the location of every instance of the highlight string in the document. The viewer_doc field contains the text document itself.

You can highlight occurrences of a clue in an individual document you have retrieved with an etx_contains scan with the etx_HiliteDoc() routine.

You can view the highlighted text contained in the etx_HiliteType object by using etx_ViewHilite() routine.

You can also use standard routines, such as ifx_lo_open() and ifx_lo_read(), or DataBlade® API large object routines, such as mi_lo_open() and mi_lo_read(), to manipulate etx_HiliteType objects.