Search API -- excluding multiple tags
I am doing a search with the expression:
"resource_type:video AND -tags=fail AND -tags=cheat"
This results in the error shown:
If I change the expression to exclude only a single tag, the search works as expected.
Is there a different syntax to search for items that don't include multiple tags?
-
Hi Alan,
To add multiple tags in the search expression, you can use the comma ",". For your requirement, you can use the expression:
"resource_type:video AND -tags=fail,cheat"
Could you please try and let me know how it goes?
Regards,
Francis0 -
Thank you, this fixes the issue with an error occurring!
However, the results are not what I expected. I have an item with a single tag "cheat" and it is getting returned when the expression includes -tags=cheat,mod.
Even items with both cheat and mod tags are getting returned.
Example on dashboard:
Tracing into the SDK, here is what is passed to the endpoint for the search params:
0 -
Hi Alan,
Could you please try
"resource_type=video AND -tags:cheat,mod"
Change the equals sign "=" to colon ":". The equals sign is expecting an exact match.
You can learn more about this here.
Please let me know how it goes.
Regards,
Francis0 -
Using the colon worked perfectly, thank you!
0
Post is closed for comments.
Comments
4 comments