mousebat / QsirchMac

A MacOS app for searching QNAP Devices
MIT License
6 stars 0 forks source link

Search with special characters #2

Open lakemike opened 4 years ago

lakemike commented 4 years ago

Dear mousebat, Again, huge thanks for bringing this tool forward. It's awesome! As a German native, one of the first things I am testing are umlaut characters. E.g. "Ä". Hence, please let me report that I get incomplete search results when I am using an umlaut: Qsirch web interface, searching "Ärzte" yields more than 1000 results, QSirchMac yields only 5 results. I am unable to spot any pattern, i.e. sometimes it hits in content and sometimes in file name or metadata. Regards

mousebat commented 4 years ago

I've been looking at the problem and the Ä is being percent encoded correctly. I'm away from the NAS at the moment and have forgotten to open the ports to it at my office. I'll test it tomorrow and see if I can find out what's going on. There must be an issue with the encoding QSirch requires if you can search correctly through the web interface. Should be an easy fix 👍

lakemike commented 4 years ago

I just looked at the URL generated by the QSirch chrome plugin: It does not percent encode the umlaut character but instead sends it via URL e.g. "...&q.string=|Ärzte&..."

mousebat commented 4 years ago

That’s very odd, in part of my url segment I specifically percentage encode the query. I wonder if it’s being decided before being actioned somewhere. I’ll keep digging...

mousebat commented 4 years ago

Ah, do you mean when you do a search in the web interface the url is not encoded? That might be the fix, let me test and check.

lakemike commented 4 years ago

Ah, do you mean when you do a search in the web interface the url is not encoded? That might be the fix, let me test and check.

Yes, exactly. At least in Chrome I see the "Ä" character in the URL.

mousebat commented 4 years ago

Ok - I think I've fixed the issue. When I was constructing my URL components before handing them to the data task, I needed to declare that the query component was already percent encoded.

Please try this version, I'm not sure if it will work as I'm kinda locked out of my share points for today LOL. Filtering should work as per QNAP docs as well (extension:"jpg" etc...).

👍

lakemike commented 4 years ago

Ok - I think I've fixed the issue. Yes, this does now work and delivers the same number of search result. Filtering works as well! Very nice!