Search API -- unexpected results
The following expression correctly returns videos with meta data LEVEL_ID=002:
"resource_type:video AND context.LEVEL_ID:002 AND NOT tags:fail,cheat"
For some reason, the following expression will return results where LEVEL_ID is not 002.
"resource_type:video AND context.LEVEL_ID:002 AND NOT /(tags:fail,cheat,mod OR context.STEAM_ID:76561198036999383/)"
Is there something incorrect about the syntax of the second expression?
The goal is to get videos with LEVEL_ID=002 and exclude any with the fail/cheat/mod or STEAM_ID=76561198036999383
-
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?
-
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
Post is closed for comments.
Comments
4 comments