5.2 Search API and "defaults"

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

5.2 Search API and "defaults"

Jump to solution

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 

1 Solution

Accepted Solutions
Highlighted
Member II

Re: 5.2 Search API and "defaults"

Jump 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.

View solution in original post

2 Replies
Highlighted
Alfresco Employee

Re: 5.2 Search API and "defaults"

Jump to solution

Try something similar to this:

{
     "query": {
       "query": "cm:title:alfresco"
     },
     "defaults": {
       "textAttributes": [
         "cm:content", "cm:name"
       ],
       "defaultFTSOperator": "AND",
       "defaultFTSFieldOperator": "OR",
       "namespace": "cm",
       "defaultFieldName": "PATH"
     }
}
Software Engineer in Alfresco Search Team.
Highlighted
Member II

Re: 5.2 Search API and "defaults"

Jump 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.

View solution in original post