Regex for Boosting Vertical Intent

Hey team -

I’m looking to boost the “financial professionals” vertical for specific queries on my experience. This is necessary because we have another rule in place that boosts locations by strength 5 for all queries in the universal tab - so we want the cases where agents are targeted in the search to still return that vertical.

{
      "criteria": {
        "searchTypes": "ALL"
      },
      "actions": [
        {
          "actionType": "BOOST_VERTICAL_INTENT",
          "boostValue": 5,
          "verticals": [
            "locations"
          ]
        }
      ],
      "name": "Boost Things"
    },
    {
      "criteria": {
        "searchTermExactlyMatches": "[Aa]gents.in.[A-Za-z]+"
      },
      "actions": [
        {
          "actionType": "BOOST_VERTICAL_INTENT",
          "boostValue": 30,
          "verticals": [
            "financial_professionals"
          ]
        }
      ],
      "name": "Boost Professionals"
    }

However. all my test searches still return the locations vertical first. I attempted my regex on regex101 and haven’t had any problems matching queries like “Agents in Kansas” “agents in kansas” or “agents in ks” but I cant seem to replicate the desired behavior on my experience.

Hey Jack,

Looks like you just need to change the criteria type from searchTermExactlyMatches to searchTermMatchesRegex to let the algorithm know you are using regex. Once I changed this criteria type, I was able to get the financial professionals to show up first!

Check out the Query Rules Criteria unit for more context on each criteria type.

The JSON will look like this:

{
      "criteria": {
        "searchTypes": "ALL"
      },
      "actions": [
        {
          "actionType": "BOOST_VERTICAL_INTENT",
          "boostValue": 5,
          "verticals": [
            "locations"
          ]
        }
      ],
      "name": "Boost Things"
    },
    {
      "criteria": {
        "searchTermMatchesRegex": "[Aa]gents.in.[A-Za-z]+"
      },
      "actions": [
        {
          "actionType": "BOOST_VERTICAL_INTENT",
          "boostValue": 30,
          "verticals": [
            "financial_professionals"
          ]
        }
      ],
      "name": "Boost Professionals"
    }