This support forum is no longer in use. Please use the Cloudinary Community at https://community.cloudinary.com/ to receive assistance from other members of the community and from Cloudinary's support team. For account-specific questions or if you believe that you've encountered a bug, please contact the Cloudinary team directly via the "submit a request" option on this support site.

Search API -- unexpected results

Comments

4 comments

  • Avatar
    Alan Lawrance

    I determined I needed escape (\) the colon used in the search expression -- which is indeed mentioned in the documentation.  But it seems like only in the case of the NOT terms within the brackets.  This works:

    "resource_type:video AND context.LEVEL_ID:002 AND NOT \\(tags\\:fail,cheat,mod OR context.STEAM_ID\\:76561198036999383\\)"

    Note that I didn't escape context.LEVEL_ID:002.  If I escape the colon there, I don't get back any matches!

    Just testing a query with only context.LEVEL_ID\\:002 doesn't pick up matches like it should.

    Any idea why I would need to escape the colons for the NOT terms, but escaping for other terms causes the search to not work as expected.

     

     

    So why would escaping the colon be required in one case, and break the query in another?

     

    0
    Comment actions Permalink
  • Avatar
    Francis Tagbo

    Hi Alan,

    Your expression was enclosed in quotes so you would need to use backslash (\) if the search term has special characters. Like for example, you are searching for the assets with LEVEL_ID value of "00:2", then you need the expression context.LEVEL_ID:00\\:2. 

    In your case, don't need to use the backslash to escape the parenthesis. Could you try to search using the expression:
    "resource_type:video AND context.LEVEL_ID:002 AND NOT (tags:fail,cheat,mod OR context.STEAM_ID:76561198036999383)"

    Let me know how it goes.

    Thanks,
    Francis

    0
    Comment actions Permalink
  • Avatar
    Alan Lawrance

    Thanks Francis, this totally clears up my understanding about this, and indeed the query works as expected without the unnecessary escapes.

    0
    Comment actions Permalink
  • Avatar
    Francis Tagbo

    You're welcome, Alan! Glad I could help :)

    0
    Comment actions Permalink

Post is closed for comments.