cancel
Showing results for 
Search instead for 
Did you mean: 

[Alfresco 5.2] search for nodes with REST API

JC83
Confirmed Champ
Confirmed Champ

Hi Everybody,

I try to play with the REST API, now I'm able to do a lot of thing but there is still something that fail.

I cannot find anything with the /queries/nodes interface.

To be true, actually, I can have a lot of result for this request while this word is never used ... (banana)

http://server:8081/alfresco/api/-default-/public/alfresco/versions/1/queries/nodes?term='name:banana':&maxItems=500000&rootNodeId=-root-

If a replace by an existing name, I have no result .. Personnaly, I can understand it better .. 

http://server:8081/alfresco/api/-default-/public/alfresco/versions/1/queries/nodes?term='name:memorandum':&maxItems=500000&rootNodeId=-root-

What am I doing wrong ? Could you understand why it find such weird result ?

The real request I would like to achieve is to have all nodes which have a properties named "ifm:ref" whith a value beginning by I .. I tries with term:ifm:ref:I* (as is is suggested here https://docs.alfresco.com/search-enterprise/latest/using/) . but .. nothing 

Could someone help me create the correct "term" ? 

Thank you !

1 ACCEPTED ANSWER

angelborroy
Community Manager Community Manager
Community Manager

You may try with the "search" API.

$ curl -X POST \
"http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search" \
-H  "accept: application/json" -H  "authorization: Basic YWRtaW46YWRtaW4=" \
-H  "Content-Type: application/json" \
-d "{  \"query\": {    \"query\": \"cm:name:z*\"  }}"
Hyland Developer Evangelist

View answer in original post

2 REPLIES 2

angelborroy
Community Manager Community Manager
Community Manager

You may try with the "search" API.

$ curl -X POST \
"http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search" \
-H  "accept: application/json" -H  "authorization: Basic YWRtaW46YWRtaW4=" \
-H  "Content-Type: application/json" \
-d "{  \"query\": {    \"query\": \"cm:name:z*\"  }}"
Hyland Developer Evangelist

thanks a lot

It works great !