String filtering
There are several filtering constraints designed to work especially with string attributes. They are useful for looking for entities with attributes that contain a specific string.
In the context of the limitations described in this chapter, you might be interested in the general rules for handling
data types and arrays described in the query language basics.
Attribute contains
- argument:string!
- the name of the entity attribute whose value will be scanned for the occurrence of the string in the second argument
- argument:string!
the arbitrary value to search for in the attribute value (case-sensitive)
The attributeContains searches the filterable or unique entity attribute
for the occurrence of the string. The constraint behaves exactly like the .
It's case-sensitive, works with national characters (since we're working with UTF-8 strings), and requires an exact
match of the searched string anywhere in the attribute value.
Returns a few products having a string epix in the attribute code.
Attribute starts with
- argument:string!
- the name of the entity attribute whose value will be tested to see if it starts with the string in the second argument
- argument:string!
the arbitrary value to search for in the attribute value (case-sensitive)
The attributeStartsWith searches the filterable or unique entity attribute
and checks if it starts with the specified string. The constraint behaves exactly like the .
It's case-sensitive, works with national characters (since we're working with UTF-8 strings), and requires an exact
match of the search string at the beginning of the attribute value.
Returns a few pages of products that start with a garmin string in the code attribute.
Attribute ends with
- argument:string!
- the name of the entity attribute whose value will be tested to see if it ends with the string in the second argument
- argument:string!
the arbitrary value to search for in the attribute value (case-sensitive)
The attributeEndssWith searches the filterable or unique entity attribute
and checks if it ends with the specified string. The constraint behaves exactly like the
.
It's case-sensitive, works with national characters (since we're working with UTF-8 strings), and requires an exact
match of the search string at the end of the attribute value.
Returns a few products that end with a solar string in the code attribute.