The branch, v4-18-test has been updated
       via  69fd70b83df mdssvc: better support for search with mdfind from Macs
      from  14380eb832d vfs_aio_pthread: use SMB_VFS_NEXT_OPENAT() in 
aio_pthread_openat_fn()

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-18-test


- Log -----------------------------------------------------------------
commit 69fd70b83df5f6a77192f6eeb3f333fb2a26643a
Author: Ralph Boehme <s...@samba.org>
Date:   Tue Aug 29 16:14:38 2023 +0200

    mdssvc: better support for search with mdfind from Macs
    
    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.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15463
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Noel Power <noel.po...@suse.com>
    
    Autobuild-User(master): Ralph Böhme <s...@samba.org>
    Autobuild-Date(master): Wed Aug 30 10:51:40 UTC 2023 on atb-devel-224
    
    (cherry picked from commit 3afa27a01ca0b81b0044d5d543a999936582e67a)
    
    Autobuild-User(v4-18-test): Jule Anger <jan...@samba.org>
    Autobuild-Date(v4-18-test): Tue Sep  5 09:28:33 UTC 2023 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_server/mdssvc/mdssvc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/mdssvc/mdssvc.c 
b/source3/rpc_server/mdssvc/mdssvc.c
index a7d5d7afc02..5f0ec0289f2 100644
--- a/source3/rpc_server/mdssvc/mdssvc.c
+++ b/source3/rpc_server/mdssvc/mdssvc.c
@@ -313,11 +313,11 @@ static bool add_results(sl_array_t *array, struct 
sl_query *slq)
        bool ok;
 
        /*
-        * Taken from a network trace against a macOS SMB Spotlight server. If
-        * the first fetch-query-results has no results yet because the search
-        * is still running, macOS returns 0x23, otherwise 0x0.
+        * Taken from network traces against a macOS SMB Spotlight server: if
+        * the search is not finished yet in the backend macOS returns 0x23,
+        * otherwise 0x0.
         */
-       if (slq->state >= SLQ_STATE_RESULTS ) {
+       if (slq->state >= SLQ_STATE_DONE) {
                status = 0;
        } else {
                status = 0x23;


-- 
Samba Shared Repository

Reply via email to