Query Rules Question: Regex & Boost Vertical Intent

Hi All,

I have an experience that has “products” and “manufacturing” as verticals. I’d really like to leverage query rules to make sure that anytime someone searches and includes the term “products” the products vertical shows first and then the manufacturing vertical shows second. When reading through the learning modules it was my understanding that leveraging the action Boost Vertical Intents and applying a “searchTermMatchesRegex”:“^.products.” would do the trick. Unfortunately, I’m not seeing the results I was expecting and was wondering if anyone in the community could help out? Below is what I’ve added to my search configuration.

"rules": [
    {
      "criteria": {
        "searchTermMatchesRegex": "^*.products.*"
      },
      "actions": [
        {
          "actionType": "BOOST_VERTICAL_INTENT",
          "boostValue": 5,
          "verticals": [
            "products"
          ]
        }
      ]
    },
    {
      "criteria": {
        "searchTermMatchesRegex": "^*.products.*"
      },
      "actions": [
        {
          "actionType": "BOOST_VERTICAL_INTENT",
          "boostValue": 4,
          "verticals": [
            "manufacturing"
          ]
        }
      ]
    }
  ]

Hi John,

Great to see an example of query rules! You have a small typo in your regex - you want ^.*products.*. You can test the regex expression here: regex101: build, test, and debug regex

You may want to do ^.*product.* so that it captures the singular and plural version of products as well.

Thanks, @afarooque! I definitely agree about changing to ^.*product.* and have made that change in the search configuration. Unfortunately, the manufacturing vertical wasn’t in the result set for the query “what are your products?” that I was testing this for in the first place. I didn’t realize that adding query rules wouldn’t boost a vertical if it’s not already in the results set. So, I’ve made a synonym set and everything is now working as expected. Thank you!!