Slow and buggy search on large documents

61 views
Skip to first unread message

Samer Albahra

unread,
Nov 15, 2017, 7:25:46 PM11/15/17
to PDFTron WebViewer
Hello,

We are running into several issues with search of XODs and hope to get your assistance on the matter.

1) Search is quite slow, especially when the file is from the network. Please note we are using `streaming: false` and correctly using content-range requests (206 partial content). When inspecting the network requests I see some documents make over 1000 requests. Is there any sort of index feature when making the XOD or other solutions we can look into as this is very poor on slow networks. If I download the file to the browser, search is significantly faster but still seems slow for something that is present in memory.

2) Rarely, search does not recover when searching for a term that is not present in the document preventing subsequent searches. I am not sure if this is related to the above issue or some other issue.

3) There is no visual indicator that a search is running. Is there any events we can hook into for showing an indicator.

Thank you,
Samer

Justin Jung

unread,
Nov 17, 2017, 2:53:03 PM11/17/17
to PDFTron WebViewer on behalf of Samer Albahra
1) Just to confirm, when you say "download the file to the browser", does that mean setting `streaming: true`? Also, there were number of significant performance improvements for searching in version 3.0. We'd recommend updating to 3.0 if you are not using it already.

2) Could you provide us with the document and the search terms that reproduces this issue?

3) You can edit ReaderControl.js to add custom events. For this particular case, you can add event fires in fullTextSearch function as follows:
fullTextSearch: function(pattern) {
  this.fireEvent('searchStarted');
  ...
  me.docViewer.textSearchInit(pattern, mode, true,
    function(result) {
      ...
      } else if (result.resultCode === Text.ResultCode.e_done) {
        ...
        me.fireEvent('searchEnded');
      }
    }
  });
},

And you can listen to those events in config.js as follows:
$(document).on('searchStarted', function() {
  // show spinner
});

$(document).on('searchEnded', function() {
  // hide spinner
});

Justin Jung
Software Developer
PDFTron Systems Inc.

Samer Albahra

unread,
Nov 17, 2017, 7:29:23 PM11/17/17
to PDFTron WebViewer
Hi Justin,

1) We are on the latest version, 3.0.1. With the file in the browser, we are using `streaming: true` however I tested with false as well and same result.

2) We can, is there an email I can send the document to?

3) Okay that helps and I assume the cancel search method in the other post won't trigger this end event correct? If not, where would I go to add such an event for canceling search?

Thank you,
Samer

Samer Albahra

unread,
Nov 20, 2017, 12:46:47 PM11/20/17
to PDFTron WebViewer
Just to update this thread, I emailed the sample XODs to sup...@pdftron.com.

Thank you,
Samer
Reply all
Reply to author
Forward
0 new messages