-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api-minor] Add support, in PDFFindController
, for mixing phrase/word searches (issue 7442)
#16247
Conversation
this.eventBus.dispatch("findfromurlhash", { | ||
source: this, | ||
query: params.get("search").replaceAll('"', ""), | ||
phraseSearch: params.get("phrase") === "true", | ||
query: phrase ? query : query.match(/\S+/g), |
Check failure
Code scanning / CodeQL
SQL database query built from user-controlled sources (experimental)
3f4c0d7
to
f8017d6
Compare
@timvandermeij How do you feel about this PR, since while it does fix an old feature request and essentially only extends an existing feature (i.e. |
I didn't check the code in detail, but in general the approach looks good to me, and given that this is apparently quite a wanted feature I'm OK with including it if it's not exposed in the default viewer. I'm much happier with this now that there is test coverage, which used to be an issue with the previous patches I've seen for this functionality, since I feared for regressions without that given that the find controller is not the easiest code. |
…rd searches (issue 7442) *Please note:* This patch only extends the `PDFFindController` implementation itself to support this functionality, however it's *purposely* not exposed in the default viewer. This replaces the previous `phraseSearch`-parameter, and a `query`-string will now always be interpreted as a phrase-search. To enable searching for individual words, the `query`-parameter must instead consist of an Array of strings. This way it's now also possible to combine phrase/word searches, with a `query`-parameter looking something like `["Lorem ipsum", "foo", "bar"]` which will search for the phrase "Lorem ipsum" *and* the words "foo" respectively "bar".
f8017d6
to
0e19c3a
Compare
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/55c9c3c329a947b/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/0f447136c43cd3a/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/55c9c3c329a947b/output.txt Total script time: 2.51 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/0f447136c43cd3a/output.txt Total script time: 10.92 mins
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/a54f12369e9b8dd/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/e9b61e69037227a/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/a54f12369e9b8dd/output.txt Total script time: 4.22 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/e9b61e69037227a/output.txt Total script time: 13.29 mins
|
Thank you for implementing this! |
Please note: This patch only extends the
PDFFindController
implementation itself to support this functionality, however it's purposely not exposed in the default viewer.This replaces the previous
phraseSearch
-parameter, and aquery
-string will now always be interpreted as a phrase-search.To enable searching for individual words, the
query
-parameter must instead consist of an Array of strings. This way it's now also possible to combine phrase/word searches, with aquery
-parameter looking something like["Lorem ipsum", "foo", "bar"]
which will search for the phrase "Lorem ipsum" and the words "foo" respectively "bar".