Surfacing a specific FAQ when a string of numbers is searched

Hi all -

I have a client that wants an FAQ to surface anytime a customer tries searching a 5 to 7 digit number that says “Looking for a Product?” They expect customers to search in their Answers experience via product ID, however, we aren’t using Products as an entity type, so they know the actual product won’t come up. Instead, they want to drive customers to their website product search.

Is there a way for Answers to recognize any 5 to 7 digit string of numbers and return that FAQ? For example, is it possible to set a query rule that would boost that entity? I found this article on JSON expressions that could be a solution, but not totally sure if it applies: Regular Expressions — Understanding JSON Schema 2020-12 documentation

Right now if you search a string of numbers, no results are returned, so my other thought was if it’s possible to surface a specific entity (that FAQ) if no results are returned, similar to how display all results can be set for vertical search.

If anyone has any ideas let me know!

Thanks,
Julian

This is possible via the following query rule:

"rules": [
{
  "criteria": {
    "searchTermMatchesRegex": "\\b\\d{5,7}\\b"
  },
  "actions": [
    {
      "actionType": "BOOST_ENTITIES",
      "entityIds": [
        "FAQ-0"
      ],
      "verticalKey": "faqs"
    }
  ]
}

],

1 Like

For anyone looking to learn more about RegEx or validate their expressions I highly recommend visiting https://regexone.com/ and https://regex101.com/ respectively

1 Like