Hi guys,
I noticed that our migrated content isn’t indexed on Confluence Cloud after migration and realised the there is a property “ac:custom-content:search-body” that we use to set keywords for indexed content. Of course I would like to have the migrated content indexed equally well as the cloud-created content is indexed.
Now, when creating new content in Cloud from scratch, this works fine. The property gets created on version 1 of the content and keywords get indexed properly. Also if we add new content versions, the indexing works fine with them as well, I guess because the property gets cloned always to a newer version starting from version 1.
However, here is the problem: If the migration contains content with more than one version, then this breaks down. Let’s say we have 3 versions of same content. None of them contains that property after the migration from Server and when I’m trying to update the keyword for that 3rd version, I get an error:
com.atlassian.confluence.api.service.exceptions.NotFoundException: Cannot update content property. Property : JsonContentProperty{id=‘null’, key=‘ac:custom-content:search-body’, content=CollapsedReference{idProperties={id=ContentId{id=499089537}, status=current, version=CollapsedReference{idProperties={number=0}, referentClass=class com.atlassian.confluence.api.model.content.Version}}, referentClass=class com.atlassian.confluence.api.model.content.Content}, version=Version{by=null, when=null, message=‘null’, number=3, syncRev=‘null’, syncRevSource=‘null’, ncsStepVersion=‘null’, ncsStepVersionSource=‘null’, confRev=‘null’, content=EmptyReference{referentClass=class com.atlassian.confluence.api.model.content.Content}}} , isSuccessful: false, isAuthorized: true, isValid: false, hasErrors: true, Errors: “Could not find Property to update.”
If I have some other content just with version 1, then this approach works well as the property does get created with the property POST-updating. But with more than 1 version already existing from the migration, then this breaks.
I guess root issue here is this (https://developer.atlassian.com/cloud/confluence/rest/api-group-content-properties/#api-wiki-rest-api-content-id-property-key-put): “Updates an existing content property. This method will also create a new property for a piece of content, if the property key does not exist and the property version is 1.”
So basically would need to be able to create a new property for the latest migrated version 1. I have tried to use both of these APIs:
and
But I guess they both create the property only for version 1, as after calling either of these methods, I still get the same error above. If I could just pass the desired version with either of those above calls, that would resolve the issue.
So, any ideas how I could create a property for a migrated content with version >1?
EDIT: Ok, doesn’t seem to be working with content that has 1 version only. Then it is possible to add the ‘ac:custom-content:search-body’ property with keywords, but the content doesn’t become searchable even if I add those keywords there. I wonder if there is some specific call I need to make to get those keywords indexed after adding them all?
EDIT2: Hmm… or am I too quick to expect the keywords to appear in the search index immediately after post migration processing? Maybe it takes some time for them to be processed? I mean for the single-version content. Doesn’t help with multi-version content as I can add the property on those.
Regards,
- Petri