Fix for Qsirch and Spotlight

mousebat
Starting out
Posts: 39
Joined: Wed Feb 12, 2020 10:39 pm

Fix for Qsirch and Spotlight

Post by mousebat »

I had a problem - no spotlight support through OS X on Catalina and Mojave machines but I think I may have fixed it.

Back in ye olden days before Apple was run by an accountant instead of a visionary, I had an OS X Server box to serve files to my mac users. One day I updated the server OS to a new version and all of a sudden spotlight server stopped working. The fix was to give the user "_spotlight" read only access to the shares.

With this in mind I added a user "_spotlight" and set a very secure password for them. I then gave this user read only access to the Shared Folders and then propagated these using the "Apply and replace all existing permissions of this folder, files and subfolders" in the "Edit Share Folder Permissions" dialog box from the "Privilege" control panel.

Low and behold it works. I'm only allowing my client Macs to connect via SMB3, something that you can set in "Advanced Options" dialog from "Win/Mac/NFS" settings in the "Network & File Services" Control Panel. Set the Highest and Lowest SMB version to 3. The QNAP is a TS-873 running 4.4.1.146 (Build 20191206) Firmware.

I've had a ticket open with QNAP since 22nd of January and was sick of the lack of reply so I took matters into my own hands.

Hope this helps someone!

MB
glennmac
Know my way around
Posts: 129
Joined: Mon Oct 22, 2018 2:56 pm

Re: Fix for Qsirch and Spotlight

Post by glennmac »

So what would the _spotlight user login be?
chrisonnas
Getting the hang of things
Posts: 50
Joined: Sat Jan 05, 2019 5:27 pm

Re: Fix for Qsirch and Spotlight

Post by chrisonnas »

mousebat wrote: Wed Feb 12, 2020 11:04 pm ... I added a user "_spotlight" and set a very secure password for them. I then gave this user read only access to the Shared Folders and then propagated these using the "Apply and replace all existing permissions of this folder, files and subfolders" in the "Edit Share Folder Permissions" dialog box from the "Privilege" control panel.
Dear mousebat,
thanks so much for posting this - I didnt see your post until today, annoyingly I was discussing this same issue on another thread in this forum!
viewtopic.php?f=30&t=143984&start=30

Adding the _spotlight user on the QNAP, giving it read-only access to the shares is easy to do. I set a password for the user, but am not sure whether you need to give that user/password to the Mac connecting to it - do you? I am confused that it works without the Mac being given access...

Connecting to the QNAP share via AFP does now allow search to work. Its not as fast as a Spotlight search on my internal drive, but file name and EXIF data from photo files are both discoverable! Its certainly fast enough for finding the right folder by name or set of files etc.

THANKYOU!! :DD :DD :DD :DD :DD
mousebat
Starting out
Posts: 39
Joined: Wed Feb 12, 2020 10:39 pm

Re: Fix for Qsirch and Spotlight

Post by mousebat »

No worries, I’m not 100% sure this is a reliable fix so I’ve written a MacOS app that interfaces with the QSirch rest api. It’s lightning fast and has the ability to fetch quick look previews. I’m still picking the bugs out of it and polishing it but should be ready soon.

At the moment it does require your QNAP to have a valid SSL certificate and as such a proper FQDN as it does it’s requests with HTTPS for security. I was thinking of submitting it to the Apple App Store so using SSL is definitely required for that.

I’ll post screenshots tomorrow for anyone who is interested ;)
ore2000
New here
Posts: 5
Joined: Tue Oct 08, 2019 5:25 am

Re: Fix for Qsirch and Spotlight

Post by ore2000 »

Yes, very interested.
mseewald
Starting out
Posts: 29
Joined: Sat Nov 11, 2017 9:38 pm

Re: Fix for Qsirch and Spotlight

Post by mseewald »

mousebat wrote: Mon Jul 27, 2020 2:28 am I’ll post screenshots tomorrow for anyone who is interested ;)
Any update? I'd be very interested as well
Spixer
First post
Posts: 1
Joined: Sun Oct 04, 2020 5:59 pm

Re: Fix for Qsirch and Spotlight

Post by Spixer »

I'm also following this. Having nightmares over Spotlight not working.
mousebat
Starting out
Posts: 39
Joined: Wed Feb 12, 2020 10:39 pm

Re: Fix for Qsirch and Spotlight

Post by mousebat »

Hi All,

Sorry for the delay - I’ll post screenshots and download link ASAP. App is built but is a little unrefined. I can’t submit it to the App Store because I’ve not strictly followed Apple’s Human Interface guidelines.

Ironically the app looks and works just like the Spotlight dialog initiated from the menu bar (runs as a daemon with no Dock icon etc...).

It does require your QNAP box to have a valid SSL certificate as Apple frowns on contacting API’s without one. This can be done with LetsEncrypt, I’m sure there are guides on this forum somewhere.

I’d like to point out that I’m not a software developer, there will be bugs but I’ll do my best to squash them if you report them. As such it’s free until I hammer it into a commercial form, I’ve spent a couple of months on my evenings and weekends making this so would be great to see some reward for my efforts but I’ll probably wait until Big Sur is released before messing around any more.

Watch this space :wink:
mseewald
Starting out
Posts: 29
Joined: Sat Nov 11, 2017 9:38 pm

Re: Fix for Qsirch and Spotlight

Post by mseewald »

mousebat wrote: Sun Oct 04, 2020 9:19 pm I’ll post screenshots and download link ASAP.
Awesome!
mousebat wrote: Sun Oct 04, 2020 9:19 pm It does require your QNAP box to have a valid SSL certificate as Apple frowns on contacting API’s without one. This can be done with LetsEncrypt, I’m sure there are guides on this forum somewhere.
Happy to test it prior to submission to App Store. I bought a certificate from QNAP and have also several docker containers with Let's encrypt certificates provided by traefik. Happy to share links to guides etc.
mousebat wrote: Sun Oct 04, 2020 9:19 pm I’d like to point out that I’m not a software developer, there will be bugs but I’ll do my best to squash them if you report them.
Of course, happy to do the reporting. May I suggest github? Could be more efficient than email.
mousebat wrote: Sun Oct 04, 2020 9:19 pm As such it’s free until I hammer it into a commercial form, I’ve spent a couple of months on my evenings and weekends making this so would be great to see some reward for my efforts but I’ll probably wait until Big Sur is released before messing around any more.
I'd be very much ok with paying for it. Have also spent money on others e.g. HoudahSpot etc.
mousebat wrote: Sun Oct 04, 2020 9:19 pm Watch this space :wink:
Will do!
mousebat
Starting out
Posts: 39
Joined: Wed Feb 12, 2020 10:39 pm

Re: Fix for Qsirch and Spotlight

Post by mousebat »

Ok here are the screenshots!
Main Search Bar
Image
Search Results
Image
Search Detail View
Image
Server Details
Image

I've blurred the files and paths as it is from a live file system. I'll be releasing the app shortly for free download, hopefully on GitHub so bugs can be tracked etc...

I've just got to work out how to safely release it and protect my code for the eventuality that I may commercialise it. The app is locked into working on Catalina for the time being I may open that up for older Mac OS if demand is high enough.
perquin
Starting out
Posts: 26
Joined: Thu Mar 29, 2012 6:19 pm

Re: Fix for Qsirch and Spotlight

Post by perquin »

Very interresting
mousebat
Starting out
Posts: 39
Joined: Wed Feb 12, 2020 10:39 pm

Re: Fix for Qsirch and Spotlight

Post by mousebat »

Here we go:

https://github.com/mousebat/QsirchMac

I've not really done much of a documentation as it's fairly intuitive to use. Just remember you have to double click the preview panel to reveal the file in Finder, double clicking the file in just the search results list doesn't work as SwiftUI framework has no allowance for double clicking in Navigation Lists, I can hack it but it's a bit buggy and does not work as it should.

The search will only return files at the moment and not directories. There is a possibility to include directories in the Qsirch API but I've got to come up with a solution for gracefully handling that on the SwiftUI side.

The app runs as a daemon with no dock icon and menu, just a menubar button to show and hide. It should traverse different spaces (Desktops) ok enough. On clicking away from the app it automatically hides - just like spotlight does. I wasn't sure if I liked that functionality so if it annoys enough people I'll write a switch in the preferences pane to disable it.

If you want to quit the app at any time just use "command and q" like you would any other app.

Hope you all like it!

mb
mseewald
Starting out
Posts: 29
Joined: Sat Nov 11, 2017 9:38 pm

Re: Fix for Qsirch and Spotlight

Post by mseewald »

Awesome! Works over here as well and really fast! I'll move to github for bug reports.
:DD
j-beda
Starting out
Posts: 15
Joined: Thu Feb 10, 2011 10:44 am

Re: Fix for Qsirch and Spotlight

Post by j-beda »

May I put in a vote for a Mojave version? Most of the machines connecting to our QNAP are still on Mojave.
mseewald
Starting out
Posts: 29
Joined: Sat Nov 11, 2017 9:38 pm

Re: Fix for Qsirch and Spotlight

Post by mseewald »

Please let me raise everyone's awareness that Spotlight support was recently added to samba. There are instructions available how to set it up. Not great to run this in addition to what QNAP provides (another samba server, another full-text index to build and to feed RAM to..), but perhaps a solution for a few forum members.
Post Reply

Return to “Qsirch & Qfiling”