Search not working with CIFS external shares

I don’t know if I am doing something wrong, but the search function doesn’t show any results from the shared folders (external CIFS).

Setup:

  1. Configure external shares, only visible to Admin
  2. Admin share folder with user
  3. User tries to search for file which is on shared but no results.
  4. User goes into the folder where the file is, it shows
  5. User does search inside that folder, and still shows no results.

I have done a occ files:scan --all but still it won’t seach through the cache. If I am in a folder of the CIFS shares and search it does show the results. But not if I am in the root folder.

I have the same problem
Not only in a CIFS, the problem occurs also in local storage.

Admin users can search, fast and complete.
Users not in admin group can’t search, but if de search start in a folder inside this local storage, the search process is go. But the search is not complete, only search by file name in the first 10-15 chars.

Any idea ?

Yes you are correct. When logged in as Admin (who own’s the shared folders) I can do a in-depth search. I assume this is because the filecache is also owned by Admin. And when it is shared with a normal user, it searches only their own filecache, and not the shared Admin filecache.

I have created ticket 1020 for it.

I’m found a workaround :

  • create an user only for own storage, it’s for simplified administration.
  • create a folder inside //files/
  • mount in this folder the external storage via Operating System.
  • set the own of the files to www-data recursively
  • set the appropriate permission (0750) recursively
  • rescan
  • share this folder with other users.

Then other users can search, reshare, mark as favorite, etc …

Regards…Cayetano

Thanks,

that is a good tip. Just need to see how I can incorporate it, since my data folder is mounted on a external NAS server for capacity (and redundancy). So I would need to mount the external storage folders inside that already mounted folder. This has to be done in the correct order during the boot up.

Gives me something to figure out :slight_smile:

Thanks @Cayetano_Gomez,

I have done a work around and seem to work now. Search works perfectly. It seems also bit quicker than having NC access the CIFS directly.

Hi,
we have exactly the same problem with the search engine and external smb shares (Nextcloud 20.0.2). Search results are only working for admin users, normal users get no results.

The smb shares are on a separate Windows server and Nextcloud (Docker) is running on Univention Corporate Server 4.4-7 errata924.

We have 300 smb folders. Only particulary users have rights to access a few folders, for example 20. In the given solution, every user would have access to all 300 smb folders or?

The smb shares should stay on the Windows server.
How can the search engine be fixed, can you please describe it more detailed?
Thank you.