nextcloud / nextcloud/fulltextsearch
Files are not removed from index when running occ fulltextsearch:index after being removed from nextcloud
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 234
- Forks
- 64
- Avg merge
- 6h 18m
- Merged PRs (30d)
- 10
Description
Hi, i use nextcloud 15, elasticsearch-6.8.23-1, files_fulltextsearch-1.2.10, fulltextsearch-1.2.10.
The problem is reproduced as follows:
- create file 1.txt with content "tmp"
- run occ fulltextsearch:index
- enter the query "tmp" and I see the correct result
- delete 1.txt from nextcloud
- run occ fulltextsearch:index
- enter the query "tmp" and see the title "search in Files for 'tmp' returned 1 results in 3ms", but the list of found files is empty
So file 1.txt is not removed from the index, although it should have been removed
In the oc_fulltextsearch_indexes table, the status of the index is correct, i.e. is 16 (INDEX_REMOVED).
If I understand correctly, then in IndexService.php in the indexProviderContentFromUser function, we get a list of documents using the $provider->generateIndexableDocuments($userId) command, then we analyze the index status of the received documents, and if necessary, update the index using the IFullTextSearchPlatform platform.
But $provider->generateIndexableDocuments($userId) will not return documents deleted from nextcloud and index is not updated with IFullTextSearchPlatform
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in IndexService.php at indexProviderContentFromUser and trace generateIndexableDocuments($userId) together with IFullTextSearchPlatform. Reproduce the deletion scenario described in the issue, then verify that a removed file is removed from the search index rather than only marked INDEX_REMOVED in oc_fulltextsearch_indexes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, php
- Domain
- search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100