Search API -- excluding multiple tags

Comments

4 comments

  • Avatar
    Francis Tagbo

    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,
    Francis

     

    0
    Comment actions Permalink
  • Avatar
    Alan Lawrance

    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
    Comment actions Permalink
  • Avatar
    Francis Tagbo

    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,
    Francis

    0
    Comment actions Permalink
  • Avatar
    Alan Lawrance

    Using the colon worked perfectly, thank you!

    0
    Comment actions Permalink

Please sign in to leave a comment.