AnsweredAssumed Answered

Return fields naming in Search API

Question asked by janardhanc on Mar 29, 2018
Latest reply on Apr 3, 2018 by janardhanc

I am trying to execute a search and retrieve some basic fields. However, there seems to be some naming differences with rest API.

 

The following request is not returning cm:title field. However, you can see that the field exists and "include properties" is able to return the field.


I tried other conventions as well like, title, @{http://www.alfresco.org/model/content/1.0 }title, @cm:titled.title.

 

Request:

{
    "query": {
        "query": "PATH:\"/app:company_home/*\"",
        "language": "afts"
    },
    "paging": {
        "skipCount": "0",
        "maxItems": "1"
    },
    "include": [
        "properties"
    ],
    "fields": [
        "id",
        "name",
        "cm:title"
    ],
    "sort": [
        {
            "type": "FIELD",
            "field": "cm:created",
            "ascending": true
        }
    ]
}

 

Response: 

{
    "list": {
        "pagination": {
            "count": 1,
            "hasMoreItems": true,
            "totalItems": 7,
            "skipCount": 0,
            "maxItems": 1
        },
        "entries": [
            {
                "entry": {
                    "name": "Data Dictionary",
                    "id": "085447d7-146e-45f8-96ef-ffbcd98b82d2",
                    "properties": {
                        "cm:title": "Data Dictionary",
                        "cm:description": "User managed definitions",
                        "app:icon": "space-icon-default"
                    }
                }
            }
        ]
    }
}

Outcomes