- Newest
- Most votes
- Most comments
Hi,
Yes, it is possible to provide multiple attributes and their corresponding values as input to the itemAttributes parameter in a single query. You can use the AND logical operator to combine multiple conditions.
Here is an example of how you can provide multiple conditions to the itemAttributes parameter in multiple queries:
{"itemAttributes": "ITEMS.SKILLS = "HTML" AND ITEMS.TITLE = "SDE"}
In this example, we are combining multiple conditions using the logical operators AND . The query will return items that have skills in HTML and have the title "SDE".
You may refer official docs for details if you want.
Hope it helps.
- The expressions for batch segment item-attribute affinity recipe do not support range expressions or logical 'OR'. Currently, the supported querys are as the following example:
{"itemAttributes": "ITEMS.genres = "Comedy" AND ITEMS.genres = "Action""}
{"itemAttributes": "ITEMS.genres = "Comedy""}
{"itemAttributes": "ITEMS.genres = "Horror" AND ITEMS.genres = "Action""}
-
Batch segment input expressions support only the "=" symbol for equality for string matching
-
The "OR" operator, it can be splitted into two queries as follows:
{ "itemAttributes" : "ITEMS.genres="Comedy""}
{ "itemAttributes" : "ITEMS.genres="Horror""}
Relevant content
- asked 4 months ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
We tried the recommendation I am getting the below error. Can you suggest what is missing ?
{"input": { "itemAttributes" : "ITEMS.SKILLS="JAVA" OR ITEMS.SKILLS="ANGULAR_JS""}, "output": {"usersList": []}, "error": "UserError: Error location line 1, index 20 : extraneous input 'OR' expecting {<EOF>, Field}"} {"input": { "itemAttributes" : "(ITEMS.SKILLS="JAVA" OR ITEMS.SKILLS="ANGULAR_JS") AND ITEMS.EXPERIENCE_RANGE_IN_YEARS_START >= 0 AND ITEMS.EXPERIENCE_RANGE_IN_YEARS_END <= 1"}, "output": {"usersList": []}, "error": "UserError: Invalid input symbol: '('"}
OR and range is not supported. But you can refer filter function to see if it fits your scenario.