{ "query": { "query": "WOOF:((H) (A minor) (Anor))" }, "defaults": { "defaultFTSOperator": "AND", "defaultFTSFieldOperator": "OR" }, "templates": [ { "name": "WOOF", "template": "(%content OR %cm:title) AND TYPE:content" } ] }
{ "query": { "query": "((WOOF:(H)) (WOOF:(A minor)) (WOOF:(Anor)))" }, "defaults": { "defaultFTSOperator": "AND", "defaultFTSFieldOperator": "OR" }, "templates": [ { "name": "WOOF", "template": "(%cm:content OR %cm:title) AND TYPE:content" } ] }
Solved! Go to Solution.
Before going into the question of the template: The use of parantheses to group query inputs is extremely weird. I don't know if the search would really be executed in a way that a user would expect.
WOOF:((H) (A minor) (Anor))
=> Given your default FTS operator + field operator config, this would effectively search for
WOOF:H OR WOOF:A OR WOOF:minor OR WOOF:Anor
=> where I would expect the user that rather intends to find what the following query would return
WOOF:H OR WOOF:"A minor" OR WOOF:Anor
As for the template: The thing is that templates are applied before field term groupings are expanded. So
WOOF:(A B)
becomes
(cm:content:(A B) OR cm:title:(A B)) AND TYPE:content
What is happening in Share is that - I assume - someone has customised it to apply WOOF as the default field name when no field name is explicitly set, and as a result, the input (A B) would be turned into
(WOOF:A WOOF:B)
You should be able to achieve the same with ReST API by specifying the defaultFieldName property with the value of WOOF in the search request JSON.
Before going into the question of the template: The use of parantheses to group query inputs is extremely weird. I don't know if the search would really be executed in a way that a user would expect.
WOOF:((H) (A minor) (Anor))
=> Given your default FTS operator + field operator config, this would effectively search for
WOOF:H OR WOOF:A OR WOOF:minor OR WOOF:Anor
=> where I would expect the user that rather intends to find what the following query would return
WOOF:H OR WOOF:"A minor" OR WOOF:Anor
As for the template: The thing is that templates are applied before field term groupings are expanded. So
WOOF:(A B)
becomes
(cm:content:(A B) OR cm:title:(A B)) AND TYPE:content
What is happening in Share is that - I assume - someone has customised it to apply WOOF as the default field name when no field name is explicitly set, and as a result, the input (A B) would be turned into
(WOOF:A WOOF:B)
You should be able to achieve the same with ReST API by specifying the defaultFieldName property with the value of WOOF in the search request JSON.
Thanks, yes that was what I was looking for.
Regards.
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.