When searching Samba via Spotlight from a Mac with mdfind, only 50 results are returned. It seems the changes for bug #15342 where one step in the right direction. There, a status indicator meaning "search is still being processed" was implemented, returning a special status indicator (0x23) in a response, when the query was still running in the backend, eg Elasticsearch, and we haven't got any result when when the Mac already comes along asking for results of a query. Turns out, we should also return 0x23, ie "search is still being processed" when we have some initial search results from the backend. Otherwise mdfind will stop querying for more results. It works in Finder, as the Finder by default employs a "live" search where it just keeps polling for more results even after the server returned an empty result set. The Finder just keeps on querying in some interval, typically 4 seconds, and a Mac server Spotlight server might return new results if new files where created that match the query, hence "live" search. Have patch, need bugnumber.
Created attachment 18074 [details] Network trace of a search Mac to Mac with many results
This bug was referenced in samba master: 3afa27a01ca0b81b0044d5d543a999936582e67a
Created attachment 18077 [details] Patch for 4.17, 4.18 and 4.19 cherry-picked from master
reassigning to Jule for inclusion into 4,17,4.18,4.19
Pushed to autobuild-v4-{19,18,17}-test.
This bug was referenced in samba v4-18-test: 69fd70b83df5f6a77192f6eeb3f333fb2a26643a
This bug was referenced in samba v4-19-test: eadd7e5f9bbe6b52e1690a37e0f1c98954e14643
This bug was referenced in samba v4-17-test: f8197d6509f166a809b53ad4ec623b628cf89285
Closing out bug report. Thanks!
This bug was referenced in samba v4-17-stable (Release samba-4.17.11): f8197d6509f166a809b53ad4ec623b628cf89285
This bug was referenced in samba v4-18-stable (Release samba-4.18.7): 69fd70b83df5f6a77192f6eeb3f333fb2a26643a
This bug was referenced in samba v4-19-stable (Release samba-4.19.2): eadd7e5f9bbe6b52e1690a37e0f1c98954e14643