Describe the bug
A clear and concise description of what the bug is.
Steps to reproduce
- create
main/sub/file.txt
- share
main folder to user alan
- share
file.txt to user alan
- alan search by
file
Expected behavior
search contains 1 result
Actual behavior
search contains 2 results:

REPORT resp:
<d:multistatus
xmlns:s="http://sabredav.org/ns"
xmlns:d="DAV:"
xmlns:oc="http://owncloud.org/ns">
<d:response>
<d:href>/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%210c6b6c58-6106-443d-850e-fa4b54b72b28:cf5e6b8a-005b-45c7-8dbe-3db2b56d9913:5e20d1ed-93c5-43b6-9280-63703c9a1fe9/sub/Screenshot%202026-03-12%20at%2011.50.32.png</d:href>
<d:propstat>
<d:prop>
<oc:fileid>0c6b6c58-6106-443d-850e-fa4b54b72b28$cf5e6b8a-005b-45c7-8dbe-3db2b56d9913!c284f647-187f-4621-b3de-f4020454e43f</oc:fileid>
<oc:file-parent>0c6b6c58-6106-443d-850e-fa4b54b72b28$cf5e6b8a-005b-45c7-8dbe-3db2b56d9913!28c0d9d5-a2b5-4b6a-b3ce-9cbe55d79c9e</oc:file-parent>
<oc:shareid>0c6b6c58-6106-443d-850e-fa4b54b72b28:cf5e6b8a-005b-45c7-8dbe-3db2b56d9913:5e20d1ed-93c5-43b6-9280-63703c9a1fe9</oc:shareid>
<oc:shareroot>/main</oc:shareroot>
<oc:remote-item-id>0c6b6c58-6106-443d-850e-fa4b54b72b28$cf5e6b8a-005b-45c7-8dbe-3db2b56d9913!b16497ef-c563-4100-82df-8a62225c71e5</oc:remote-item-id>
<oc:name>Screenshot 2026-03-12 at 11.50.32.png</oc:name>
<d:getlastmodified>Thu, 12 Mar 2026 10:50:53 GMT</d:getlastmodified>
<oc:permissions>S</oc:permissions>
<oc:highlights></oc:highlights>
<d:getcontenttype>image/png</d:getcontenttype>
<oc:has-preview>1</oc:has-preview>
<oc:tags></oc:tags>
<d:getetag></d:getetag>
<d:resourcetype></d:resourcetype>
<d:getcontentlength>148091</d:getcontentlength>
<oc:score>3.587174892425537</oc:score>
<oc:privatelink>https://localhost:9200/f/0c6b6c58-6106-443d-850e-fa4b54b72b28$cf5e6b8a-005b-45c7-8dbe-3db2b56d9913%21c284f647-187f-4621-b3de-f4020454e43f</oc:privatelink>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%210c6b6c58-6106-443d-850e-fa4b54b72b28:cf5e6b8a-005b-45c7-8dbe-3db2b56d9913:e83bea6b-ea6a-4d35-85cd-78145c1156cb</d:href>
<d:propstat>
<d:prop>
<oc:fileid>0c6b6c58-6106-443d-850e-fa4b54b72b28$cf5e6b8a-005b-45c7-8dbe-3db2b56d9913!c284f647-187f-4621-b3de-f4020454e43f</oc:fileid>
<oc:file-parent>0c6b6c58-6106-443d-850e-fa4b54b72b28$cf5e6b8a-005b-45c7-8dbe-3db2b56d9913!28c0d9d5-a2b5-4b6a-b3ce-9cbe55d79c9e</oc:file-parent>
<oc:shareid>0c6b6c58-6106-443d-850e-fa4b54b72b28:cf5e6b8a-005b-45c7-8dbe-3db2b56d9913:e83bea6b-ea6a-4d35-85cd-78145c1156cb</oc:shareid>
<oc:shareroot>/main/sub/Screenshot 2026-03-12 at 11.50.32.png</oc:shareroot>
<oc:remote-item-id>0c6b6c58-6106-443d-850e-fa4b54b72b28$cf5e6b8a-005b-45c7-8dbe-3db2b56d9913!c284f647-187f-4621-b3de-f4020454e43f</oc:remote-item-id>
<oc:name>Screenshot 2026-03-12 at 11.50.32.png</oc:name>
<d:getlastmodified>Thu, 12 Mar 2026 10:50:53 GMT</d:getlastmodified>
<oc:permissions>SM</oc:permissions>
<oc:highlights></oc:highlights>
<d:getcontenttype>image/png</d:getcontenttype>
<oc:has-preview>1</oc:has-preview>
<oc:tags></oc:tags>
<d:getetag></d:getetag>
<d:resourcetype></d:resourcetype>
<d:getcontentlength>148091</d:getcontentlength>
<oc:score>3.587174892425537</oc:score>
<oc:privatelink>https://localhost:9200/f/0c6b6c58-6106-443d-850e-fa4b54b72b28$cf5e6b8a-005b-45c7-8dbe-3db2b56d9913%21c284f647-187f-4621-b3de-f4020454e43f</oc:privatelink>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
Setup
Please describe how you started the server and provide a list of relevant environment variables or configuration files.
Details
OC_XXX=somevalue
OC_YYY=somevalue
PROXY_XXX=somevalue
Additional context
Add any other context about the problem here.
Describe the bug
A clear and concise description of what the bug is.
Steps to reproduce
main/sub/file.txtmainfolder to user alanfile.txtto user alanfileExpected behavior
search contains 1 result
Actual behavior
search contains 2 results:

REPORT resp:
Setup
Please describe how you started the server and provide a list of relevant environment variables or configuration files.
Details
Additional context
Add any other context about the problem here.