Cancel/abort search programmatically

Which product are you using?
PDF.js Express Plus

PDF.js Express Version
8.7.2

Detailed description of issue
we are using “textSearchInit” api for multi word searching. we are looking for cancel/abort search option/api to stop search further. is there any way to do?

Expected behaviour
search should stop immediatly

Does your issue happen with every document, or just one?
yes

Link to document
NA

Code snippet
NA

Hello prajneshu.khandavall,

In the textSearchInit you can set the options for what type of search.
You can set fullSearch to false to do a single search, or true for a full search.
The onResult callback is called when a result is found. You could then call: documentViewer.clearSearchResults() to stop the search and clear the search UI

Best regards,
Tyler