IDOL 24.4
IDOL Expert

# Highlight Results

IDOL Server is able to highlight text in three of its actions. It can highlight:

- text supplied in the `Text` parameter of the `Highlight` action.

- document content in the results of the Query action.

- the HTML output of the View action.

The behavior of highlighting is broadly similar across these operations. IDOL Server determines highlight matches using language rules (similar to query matches) and then surrounds these matches with a start tag and end tag of your choice.

For example, you might use HTML markup as start and end tags to display the output in a Web browser, with specified terms rendered to stand out visually.

Although highlighting functionality is used by a number of IDOL products, the logic that IDOL uses to find matches to highlight (and insert markup) is typically performed by the IDOL Content component.

## Highlight Effectively

Highlighting uses IDOL language capabilities. For example, it uses stemming so that you do not have to specify various forms of a term.

For more precise highlighting, you can use Boolean and proximity operators, to take advantage of IDOL advanced query syntax.

In the `Highlight` action, if you supply HTML content to highlight, you must set `XMLFormat` to `True` to instruct IDOL to take into account the structure of markup languages (so that the result is still valid XML or HTML).

If highlighting is not working as expected, it might be helpful to test using the `Highlight` action directly with your Content component. In particular, check the language configuration, and specify the `LanguageType` parameter explicitly in the action.

## Highlight with the View action

The IDOL `View` action uses the Content component `Highlight` action to highlight terms. Therefore, you can approach it in much the same way.

Because of this, the configuration of the Content component might influence the behavior of the `View` component highlighting. The `View` component generally processes HTML, so it always uses the `XMLFormat` option in the action it sends to Content. It allows you to supply multiple start tag and end tag pairs so that you can highlight each term with a different visual style.

## Examples

Here are examples of each highlighting action. For more details about parameters, refer to the IDOL Server Reference.

- Wrap a single word in an arbitrary string in default start and end tags:

      action=highlight&text=IDOL+Server+can+highlight+text&links=server

  Output:

  Copy

      <autn:content>
         IDOL <font color=red>Server</font> can highlight text
      </autn:content>

- Surround the matching text in a query action specifying `StartTag` and `EndTag`.

  NOTE: Note that matching is matched by match:

      action=query&text=match+highlight&highlight=terms&printfields=drecontent&starttag=*&endtag=*

  Output:

  Copy

      <DRECONTENT>
         This is sample text for *matching*. Hopefully you can see your *matches* *highlighted*.
      </DRECONTENT>

- Decorate some search terms in a converted document with the `View` action:

  NOTE: The `StartTag` and `EndTag` parameters should be URL encoded, but are left plain in this example for clarity.

      action=view&reference=C:/viewing.pdf&links=viewing;service&noaci=True&multihighlight=True&starttag=<b>;<i>&endtag=</b>;</i>

  Output:

  Copy

      <html>
      ... <b>Viewing</b> <i>Service</i> ...
      </html>

Copyright 2024 Open Text
Version 24.4 | Last updated September 2024

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: IDOL 24.4

Topic Title: Highlight Results