GraphQL Tag search using CONTAINS_NOT – Adobe Experience League Community

Hi folks,

 

I have a (simplified) query for searching Content Fragments where sometimes I want to exclude certain tags:

 

query getHelpFaqSearch(
$value1: String!,
$operator1: StringOperator = CONTAINS) {
helpFaqList (
filter: {
_tags: {
_logOp: AND
_expressions: [
{
value: $value1,
_operator: $operator1
}
]
}
}
) {
items {
question
answer {
html
}
lastUpdated
tags
_path
}
}
}

However; if I use the VARs:
{
     “value1”: “domain:digital/booking/make”,
     “operator1”: “CONTAINS_NOT”
}

 

I get back results like:

 

“tags”: [
    “domain:digital/booking/make”,
    “domain:digital/booking/connections”,
    “domain:digital/travel/day-of-travel”,
    “domain:digital/travel/get-ready-to-travel”
],

 

This entry doesn’t return:

“tags”: [
    “domain:digital/booking/make”
],

 

If on the second example I add another tag then that results returns also. So the result is getting hit because of the new tag.

 

Is there anyway of excluding a CF if a tag exists in both cases?

 

Thanks,

Graham

Read more here: Source link