Working with Basic or Advanced Filter Expressions
Filter expressions define the conditions to filter items based on specific item fields. A filter expression evaluates each item against the specified fields to determine which items will be included in the search results. You can define filter expressions for:
-
filter categories (called menu categories)
-
filter subcategories (called menu items)
-
filter options (called answers)
There are two types of filter expressions: basic and advanced. For more information about basic and advanced filter expressions, see Creating Basic Filter Expressions and Creating Advanced Filter Expressions.
Creating Basic Filter Expressions
The default catalog template doesn't require any setup and supports basic filter expressions. Each filter category, subcategory, and option can have only one associated basic filter expression. A basic filter expression searches against a single item field.
To create a basic filter expression:
-
Edit a catalog (called product).
-
Edit one of the following records:
-
filter categories (called menu categories)
-
filter subcategories (called menu items)
-
filter options (called answers)
-
-
Go to the Filter Expressions subtab.
-
Define the basic filter expression:
-
In the Item Field field, select the item field you want to use for filtering.
-
In the Operator field, select the condition to compare the field against the value. Examples of operators include contains and starts with.
The available operators depend on the field you select.
-
In the Value field, enter the value to evaluate against the item field.
-
-
Click Save.
Creating Advanced Filter Expressions
If you work with an advanced catalog template (called an origin), basic filter expressions are disregarded, and you must define advanced filter expressions. Advanced filter expressions can search against multiple item fields defined in the advanced catalog template. You can define only one advanced filter expression for each filter category, filter subcategory, and filter option.
To create an advanced filter expression:
-
Edit a catalog (called a product).
-
Edit one of the following records:
-
filter category (called menu category)
-
filter subcategory (called menu item)
-
filter options (called answers)
-
-
Go to the Filter Expressions subtab.
-
In the Origin field, select the advanced template (called the origin) associated with the catalog.
-
In the sublist line, click Build to open the wizard for the Filter Expression field.
-
In the popup wizard:
-
Select the item field you want to use for filtering.
-
Select an operator.
The available operators depend on the field you select.
-
Enter the filter text.
-
Click OK.
-
-
To filter on multiple fields and retrieve a more specific subset of items, repeat step 6 for each field.
When adding another field, select a logical operator (AND or OR) to combine the condtions. AND produces a more restrictive condition, whereas OR results in a less restrictive condition.
The wizard content is automatically copied to the Filter Expression field in JSON format. This is the syntax:
[["fieldID1","operator","value"],"and",["fieldID2","operator","value"]]
-
Click Save.