Searching a sub-folder with same name as parent folder with filter `In here` returns empty result
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 274
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 106
Description
## Describe the bug
Searching a sub-folder with same name as parent folder with filter `In here` returns empty result
## Steps to reproduce
Steps to reproduce the behavior:
1. As a user create the folder `NewFolder`
2. Inside the folder `NewFolder` create another folder with the same name i.e `NewFolder`
3. From inside of the parent `NewFolder` search "New" with filter `In here`
## Expected behavior
The search list should display the subfolder `NewFolder` in the search result
Payload
```console
name:"*new*" scope:c7d99f6e-50c4-4ed6-8616-ac2c77b4e7eb$8767d373-b071-4713-beef-d1cea306d2e8!cf44f1a7-0fa4-42d5-ad62-097fd1598c93
8
```
Response
```console
```
## Actual behavior
The list is empty. Note that this only happens when the search is performed with `in here` filter with `everywhere` filter the search result is accurate also it happens in the second level only. For instance, if I make a new folder `NewFolder/NewFolder/NewFolder` and search inside `NewFolder/NewFolder` with the same filter it gives me two responses one response redirects to its parent but the response should be 1 i.e child folder?
## Setup
Please describe how you started the server and provide a list of relevant environment variables or configuration files.
```console
OCIS_COMMIT_ID= 3e0ae4c657dc30df125db87d47ea3e7a076d7b51
```
## Additional context
https://github.com/owncloud/ocis/assets/41103328/12009196-b982-4a85-8fef-4150d278d96a
Contributor guide
Research direction
Reproduce the supplied oc:search-files request using the `In here` scope for nested folders with identical names, then compare it with an `everywhere` search. Trace the search entry point handling the scope and parent path; done means the child folder appears once in the filtered result and the response does not redirect to its parent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100