Search in document method - Fluid Topics - Latest

Fluid Topics Designer Guide

Category
Reference Guides
Audience
public
Version
Latest

The FluidTopicsReaderService.searchInDocument() method allows designers to set the user's search in document query.

For example, the following codeblocks in a Custom component create a button that allows users to clear the current search in document query:

HTML:

<ft-button id="searchBtn" type="button" outlined icon="backspace" iconVariant="material">Clear search in document query</ft-button>

JavaScript:

const btn = document.getElementById("searchBtn");
btn.addEventListener("click", function () {
    FluidTopicsReaderService.searchInDocument("");
});

This clears the highlight of words matching the search in document query.

Using the FluidTopicsReaderService.searchInDocument() method updates the state of: