I'm trying to use REST API to search in the repository for documents with custom properties.
I succesfully created a custom model with this aspects (among others):
<aspect name="sws:projectIdentifier">
<title>SWS Project Code</title>
<description>Unique project identifier</description>
<properties>
<property name="sws:projectCode">
<type>d:text</type>
<mandatory>true</mandatory>
<constraints>
<constraint ref="sws:projectCodeFormat" />
</constraints>
</property>
</properties>
</aspect>
<aspect name="sws:bimLinkable">
<title>BIM Linkable</title>
<description>Defines the link to a BIM element</description>
<properties>
<property name="sws:modelUrn">
<type>d:text</type>
</property>
<property name="sws:elementUniqueId">
<type>d:text</type>
</property>
<property name="sws:functionalSystem">
<type>d:text</type>
</property>
<property name="sws:elementCategory">
<type>d:text</type>
</property>
</properties>
</aspect>I added these aspects and set the properties to one of my documents in the repository (I can't embed an image, so you have to take my word for it), and if I try to search in Share for, i.e.
TYPE:"cm:content" AND sws:functionalSystem:"Access Shaft" AND sws:projectCode:"MIWP024"
I correctly get the document, but if I try to use the REST API, I get an empty list.
This is the request:
POST http://localhost:8082/alfresco/api/-default-/public/search/versions/1/search
here's the body:
{
"query": {
"query": "TYPE:\"cm:content\" AND sws:funcitonalSystem:\"Access Shaft\" AND sws:projectCode:\"MIWP024\""
},
"include": ["properties"]
}The response body is:
{
"list": {
"pagination": {
"count": 0,
"hasMoreItems": false,
"totalItems": 0,
"skipCount": 0,
"maxItems": 100
},
"context": {
"consistency": {
"lastTxId": 635
}
},
"entries": []
}
}Properties are there, I can see them in Share and If I search for name:
{
"query": {
"query": "TYPE:\"cm:content\" AND name:\"MC-03\""
},
"include": ["properties"]
}I get the element:
{
"list": {
"pagination": {
"count": 1,
"hasMoreItems": false,
"totalItems": 1,
"skipCount": 0,
"maxItems": 100
},
"context": {
"consistency": {
"lastTxId": 635
}
},
"entries": [
{
"entry": {
"isFile": true,
"createdByUser": {
"id": "admin",
"displayName": "Administrator"
},
"modifiedAt": "2019-09-24T10:23:31.677+0000",
"nodeType": "cm:content",
"content": {
"mimeType": "application/pdf",
"mimeTypeName": "Adobe PDF Document",
"sizeInBytes": 431392,
"encoding": "UTF-8"
},
"parentId": "ec429f71-1d5c-46cb-8b1b-a56820cadd02",
"createdAt": "2019-09-24T10:03:05.980+0000",
"isFolder": false,
"search": {
"score": 1.0
},
"modifiedByUser": {
"id": "admin",
"displayName": "Administrator"
},
"name": "MC-03 - TUNNEL CONSTRUCTION SHAFT - PLAN SECTION - INITIAL ROCK SUPPORT.pdf",
"location": "nodes",
"id": "9d1eb08b-cf01-4fb2-ae32-710adbfb5159",
"properties": {
"cm:title": "D:\\Users\\02_TempPDF - Sheet - MC-03 - TUNNEL CONSTRUCTION SHAFT - PLAN SECTION - INITIAL ROCK SUPPORT",
"sws:projectCode": "MIWP024",
"cm:versionType": "MAJOR",
"cm:versionLabel": "1.0",
"sws:modelUrn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6enJwdWEyZW9sdG5yeHBzazdwbjNhNXB2bmVkcDIyd2ZfNWQ4OGVlZmUwNWM1NzUyOTc4Zjg4NzRiL0JDUlVBX0MtQy1CSU0tMDMtMDAtMDAtMDMubndj",
"cm:author": "xxxxxx",
"sws:functionalSystem": "Access Shaft",
"sws:elementCategory": "Rock Support",
"cm:lastThumbnailModification": [
"doclib:1569319514231",
"imgpreview:1569329952072"
]
}
}
}
]
}
}I cannot see any error in the logs (docker-compose logs -f doesn't output anything when I submit the request).
Is there something wrong in my syntax?
Thanks in advance for the attention!