Getting multiple callbacks from search when one is expected


I’m facing a very weird issue with searching functionality in the library version 8.7.2 (core). The problem is that when I try to search a long text containing wildcards, I get multiple searchListener callbacks. In some of the callbacks, there are no search results found and in one of the callbacks, I get that one result is found which is the expected result. Eg. search query in this scenario is blow

ater Ingress into Unit on Ground Floor*A report was received from BC Building Science with several recommendations for*repair.*Directives: Council has directed that 3 quotations for repair be requested using the*BC Building Science report repair options and recommendations as a guideline for a

With some other search terms, sometimes, I don’t even get any callback, however the result is highlighted in the pdf. Example search query is below

leased or rented at any given time.*(b) No owner shall rent or lease their unit on anything less than a*yearly basis, or such longer term as the Council may establish.*(c) These limitations shall be administered and enforced by the Strata*Council```

PDF is this ->

Here is the search functionality


var search = function(search_term) {
console.log("Initiating search: " + search_term)
pdfjs_instance.UI.searchText(search_term, {
pdfjs_instance.UI.closeElements([ ‘searchPanel’ ]);

Here is the search listener function

var searchListener = function(searchValue, options, results) {
console.log(CALLBACK: ${searchValue}.)
console.log(Time taken ${( - start_time) / 1000}s. Total results found ${results.length})

Hello simar.i3r,

Thank you for raising this, however I think the code snippet is incomplete or I don’t have the full picture. Can you provide a minimal sample to reproduce?

Best regards,