I am trying to pass the "defaults" options of "defaultFTSFieldOperator" and "defaultFTSOperator" to the search API and each time I include defaults, I get an error from Alfresco. I am not sure if I am providing them wrong or if there is an issue with passing these to the server in Alfresco 5.2.0. I have tried using curl as well as ADF(2.4) to pass the request and both have the same issue. I have also tried on two different servers running 5.2. I can provide more information as requested/necessary.
reference links:
Search API | Alfresco Documentation
Alfresco Content Services REST API Explorer
Solved! Go to Solution.
Thanks,
I figured out my issue here. We are using "query": "(<value to search>)" at the moment and the API doesn't seem to like being passed a search term without a field and then being told to "AND" it, which makes sense I guess. I am going to see if we can revert to specifying the fields again but I unfortunately cannot remember the reason we moved away from it in the first place. I will update here when I have a chance to work with this again. Thank you.
Try something similar to this:
{
"query": {
"query": "cm:title:alfresco"
},
"defaults": {
"textAttributes": [
"cm:content", "cm:name"
],
"defaultFTSOperator": "AND",
"defaultFTSFieldOperator": "OR",
"namespace": "cm",
"defaultFieldName": "PATH"
}
}
Thanks,
I figured out my issue here. We are using "query": "(<value to search>)" at the moment and the API doesn't seem to like being passed a search term without a field and then being told to "AND" it, which makes sense I guess. I am going to see if we can revert to specifying the fields again but I unfortunately cannot remember the reason we moved away from it in the first place. I will update here when I have a chance to work with this again. Thank you.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
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.