04-17-2020 06:41 PM
{ "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" } ] }
04-18-2020 09:56 AM
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.
04-18-2020 09:56 AM
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.
04-19-2020 02:09 PM
Thanks, yes that was what I was looking for.
Regards.
Explore our Alfresco products with the links below. Use labels to filter content by product module.