Hi all,
I want to search for content properties - which I have posted via REST - via REST. I followed this guide: https://developer.atlassian.com/confdev/confluence-server-rest-api/content-properties-in-the-rest-api.
What I have managed to do so far
- Post an arbitrary content property (key: “doclang”, value: “de”) to a page.
- Access it via
{baseurl}/{contextpath}/rest/api/content/{pageid}/property/doclang
and receive a result:
{
"id": "154173446",
"key": "doclang",
"value": "de",
"version": {
"when": "2017-09-07T11:56:04.000+02:00",
"message": "",
"number": 1,
"minorEdit": false,
"hidden": false
},
"_links": {
"base": "{baseurl}",
"context": "",
"self": "{baseurl}/{contextpath}/rest/api/content/{id}/property/doclang"
},
"_expandable": {
"content": "/rest/api/content/{id}"
}
}
- Set up a P2 add-on index schema definition in an “empty” plugin (no Java classes). The
atlassian-plugin.xml
looks like this:
<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<content-property-index-schema key="doclang-confluence-index-schema">
<key property-key="doclang">
<extract path="value" type="string" />
</key>
</content-property-index-schema>
</atlassian-plugin>
- The index schema definition gets recognized (I know this, because if it was not working, then I would get a
status code 400
when looking for the content property).
Problem
But if I search for the property ({baseurl}/{contextpath}/rest/api/content/search?cql=content.property[doclang].value=%22de%22
), then I will get no results:
{
"results": [],
"start": 0,
"limit": 25,
"size": 0,
"_links": {
"self": "{baseurl}/{contextpath}/rest/api/content/search?cql=content.property%5Bdoclang%5D.value=%22de%22",
"base": "{baseurl}",
"context": ""
}
}
What am I missing? Please help.
Best regards
Alex
Edit:
I have already tried to reindex all contents, restarted the instance and I have posted the content property to a newly created page after installing the index schema definition.