Hi there,
I'm new to Alfresco development so please, bare with me.
I post the following body to the search api (using postman)
{ "query": { "language": "afts", "userQuery": null, "query": "+TYPE:\"cm:content\" AND content.mimetype:\"image/vnd.dwg\" AND ANCESTOR:\"workspace://SpacesStore/7e369873-7b19-4d0d-bc8e-fab2b50ca641\"" }, "paging": { "maxItems": 25, "skipCount": 0 }, "include": null, "includeRequest": false, "fields": [ "cm:description", "cm:title", "cm:versionLabel" ], "sort": [ { "type": "FIELD", "field": "cm:name", "ascending": true } ], "templates": null, "defaults": null, "localization": { "timezone": null, "locales": [ "en-US" ] }, "filterQueries": null, "facetQueries": null, "facetFields": null, "facetIntervals": null, "pivots": null, "stats": null, "spellcheck": null, "scope": null, "limits": null, "highlight": null, "ranges": null }
and I get
{ "list": { "pagination": { "count": 4, "hasMoreItems": false, "totalItems": 4, "skipCount": 0, "maxItems": 25 }, "context": { "consistency": { "lastTxId": 348 } }, "entries": [ { "entry": {} }, { "entry": {} }, { "entry": {} }, { "entry": {} } ] } }
As you can see, I get empty entries.
Now, if I remove the fields frommy qury, then I get the result expected.
However, I need to get those properties in the result.
Any idea?
Solved! Go to Solution.
Forget it, I found the solution.
In stead of defineing the fields, I just needed to include the properties. The right query body would now look like
{ "query": { "language": "afts", "userQuery": null, "query": "+TYPE:\"cm:content\" AND content.mimetype:\"image/vnd.dwg\" AND ANCESTOR:\"workspace://SpacesStore/7e369873-7b19-4d0d-bc8e-fab2b50ca641\"" }, "paging": { "maxItems": 25, "skipCount": 0 }, "include": [ "properties" ], "includeRequest": false, "fields": null, "sort": [ { "type": "FIELD", "field": "cm:name", "ascending": true } ], "templates": null, "defaults": null, "localization": { "timezone": null, "locales": [ "en-US" ] }, "filterQueries": null, "facetQueries": null, "facetFields": null, "facetIntervals": null, "pivots": null, "stats": null, "spellcheck": null, "scope": null, "limits": null, "highlight": null, "ranges": null }
I forgot to mention that I'm using the Community edition version 7.2 is that can make a difference....
Forget it, I found the solution.
In stead of defineing the fields, I just needed to include the properties. The right query body would now look like
{ "query": { "language": "afts", "userQuery": null, "query": "+TYPE:\"cm:content\" AND content.mimetype:\"image/vnd.dwg\" AND ANCESTOR:\"workspace://SpacesStore/7e369873-7b19-4d0d-bc8e-fab2b50ca641\"" }, "paging": { "maxItems": 25, "skipCount": 0 }, "include": [ "properties" ], "includeRequest": false, "fields": null, "sort": [ { "type": "FIELD", "field": "cm:name", "ascending": true } ], "templates": null, "defaults": null, "localization": { "timezone": null, "locales": [ "en-US" ] }, "filterQueries": null, "facetQueries": null, "facetFields": null, "facetIntervals": null, "pivots": null, "stats": null, "spellcheck": null, "scope": null, "limits": null, "highlight": null, "ranges": null }
Discussions, help and advice about the Alfresco Development Framework.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.