Bug 15463 - macOS mdfind returns only 50 results
Summary: macOS mdfind returns only 50 results
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: DCE-RPCs and pipes (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-29 14:07 UTC by Ralph Böhme
Modified: 2023-10-16 14:19 UTC (History)
2 users (show)

See Also:


Attachments
Network trace of a search Mac to Mac with many results (2.28 MB, application/octet-stream)
2023-08-29 14:09 UTC, Ralph Böhme
no flags Details
Patch for 4.17, 4.18 and 4.19 cherry-picked from master (2.55 KB, patch)
2023-09-04 13:49 UTC, Ralph Böhme
npower: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2023-08-29 14:07:57 UTC
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.
Comment 1 Ralph Böhme 2023-08-29 14:09:00 UTC
Created attachment 18074 [details]
Network trace of a search Mac to Mac with many results
Comment 2 Samba QA Contact 2023-08-30 10:52:03 UTC
This bug was referenced in samba master:

3afa27a01ca0b81b0044d5d543a999936582e67a
Comment 3 Ralph Böhme 2023-09-04 13:49:53 UTC
Created attachment 18077 [details]
Patch for 4.17, 4.18 and 4.19 cherry-picked from master
Comment 4 Noel Power 2023-09-05 07:11:35 UTC
reassigning to Jule for inclusion into 4,17,4.18,4.19
Comment 5 Jule Anger 2023-09-05 08:09:34 UTC
Pushed to autobuild-v4-{19,18,17}-test.
Comment 6 Samba QA Contact 2023-09-05 09:29:04 UTC
This bug was referenced in samba v4-18-test:

69fd70b83df5f6a77192f6eeb3f333fb2a26643a
Comment 7 Samba QA Contact 2023-09-05 09:34:03 UTC
This bug was referenced in samba v4-19-test:

eadd7e5f9bbe6b52e1690a37e0f1c98954e14643
Comment 8 Samba QA Contact 2023-09-05 10:02:03 UTC
This bug was referenced in samba v4-17-test:

f8197d6509f166a809b53ad4ec623b628cf89285
Comment 9 Jule Anger 2023-09-05 13:45:50 UTC
Closing out bug report.

Thanks!
Comment 10 Samba QA Contact 2023-09-07 09:03:59 UTC
This bug was referenced in samba v4-17-stable (Release samba-4.17.11):

f8197d6509f166a809b53ad4ec623b628cf89285
Comment 11 Samba QA Contact 2023-09-27 08:16:11 UTC
This bug was referenced in samba v4-18-stable (Release samba-4.18.7):

69fd70b83df5f6a77192f6eeb3f333fb2a26643a
Comment 12 Samba QA Contact 2023-10-16 14:19:35 UTC
This bug was referenced in samba v4-19-stable (Release samba-4.19.2):

eadd7e5f9bbe6b52e1690a37e0f1c98954e14643