Skip to main content

WordSearch

How to use the WordSearch operator​

The WordSearch operator returns the items for any defined string within any selected attribute.

Allowed Children​

String, Attributes of type string, String Operator and Value Transforms nodes

Requirements​

Must have 2 children, the first child is the string to search in, the second child is the string to search for

Return Type​

Item Ids Set

Example: Simple word search query

Find items with an attribute value that contains the term "there".

{
"type": "Query",
"properties": {
"dodiCode": "designs_welcomes",
"attributes": ["attributes_welcomesName"]
},
"children": [
{
"type": "WordSearch",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_welcomesName"
}
},
{
"type": "String",
"value": ["there"]
}
]
}
]
}
Example: Multiple word search query

Find items with a attribute value that contains the terms "Hello" and "there".

{
"type": "Query",
"properties": {
"dodiCode": "designs_welcomes",
"attributes": ["attributes_welcomesName"]
},
"children": [
{
"type": "And",
"children": [
{
"type": "Word Search",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_welcomesName"
}
},
{
"type": "String",
"value": ["Hello"]
}
]
},
{
"type": "WordSearch",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_welcomesName"
}
},
{
"type": "String",
"value": ["there"]
}
]
}
]
}
]
}