Details
-
Bug
-
Resolution: Fixed
-
Major
-
0.5
-
None
-
Unknown
-
Description
Problem
When the request that creates a collection through the collections REST API already contains a list of spaces, and the collection is then switched to the wiki pages document store, no page of those spaces is ever indexed, and nothing is logged. The pages are listed as documents of the collection, but it has no chunks. Reindexing does not help.
The problem does not occur when the spaces are chosen in the collection's edit form, or when they are sent through the REST API to a collection that already exists.
Steps to reproduce
- Send PUT /rest/wikis/xwiki/aiLLM/collections/Test for a collection that does not exist yet, with a JSON body that contains "document_spaces": ["Sandbox"].
- Set the documentStore property of the collection object to xwiki, for example with PUT /rest/wikis/xwiki/spaces/AI/spaces/Collections/spaces/Test/pages/WebHome/objects/AI.Collections.Code.CollectionsClass/0/properties/documentStore. The collections REST API has no field for the document store.
- Trigger a reindex of the collection and wait for it to finish.
- Open the chunks list of the collection.
Result
The collection has no chunks. GET /rest/wikis/xwiki/aiLLM/collections/Test/documents lists the pages of the space.
Expected
The pages of the space are indexed.
Cause
When the collection object has no list of spaces yet, the REST API stores the list in a different storage form than the one declared by the collection class and written by the edit form. The query that finds the collections a page belongs to only reads the declared form.
Workaround
Create the collection without document_spaces, then send the spaces in a second PUT request.