Module Assessment | Yext Hitchhikers Platform

loading
You must include a first name and last name in your profile to create challenge environments.

Background

In the last challenge you created a Search config with verticals for events and restaurants. Now it’s time to set up these two verticals. Additionally, you know that people are always asking about things like gift cards. You want to make sure you can answer these questions in Search so you decide to add an FAQs vertical to your config and set that up as well.

To set up these three verticals, you will add:

  1. A new vertical - You will first add the FAQs vertical to the Search config.
  2. Saved filters - Saved filters allow you to choose which entities can potentially show up in Search.
    1. FAQs vertical - You will show approved FAQs that have answers filled in.
    2. Restaurants vertical - You also want to make sure diners don’t go to locations that are permanently closed by not surfacing them in search results.
    3. Events vertical - You don’t want to show events that have already passed, so you’ll filter for events in the future.
  3. Searchable fields - Searchable fields tell the algorithm which fields to index on. You’ll make promoting events searchable on the Restaurants vertical so that when users search for an event, the hosting restaurant surfaces.
  4. Facets - Having facets or filters available makes the end consumer experience so much easier. You’ll add facets to the Restaurants vertical for users to narrow their search based on restaurant features and restaurant type.
  5. Default Sorting - Default sorting allows you to set the order of results users see by default and show the most relevant results first. You’ll update the default sorting for the Events vertical to show events by relevance and then in chronological order.

Your Challenge

Before we make any changes, let’s check out what search results currently look like. Navigate to Search > Brand Search > Test Search. Test out a few queries in your full screen Test Search:

  1. Run a search for “faqs” and “gift cards”. Note how nothing is returned.
  2. Run a search for “Tyler, TX”. Note that the restaurant is still returning, but it’s marked as closed, which is a terrible customer experience!
  3. Run a search for “Find that tacomania” (the name of one of the most popular events). Note that the restaurant where this is taking place does not show up – only the event shows up.
  4. Run a search for “restaurants” and switch to the Restaurants tab. Note how no facets are shown.
  5. Switch back to universal search. Run a search for “events”. Note how the events are returned in a random order.

You’ll fix all of this in this challenge. Since we’re updating the configuration for verticals, you’ll make changes in the Verticals screen if you’re editing in the UI or in the verticals object if you’re editing in the JSON editor.

Note: If you’re not seeing results when you run the above or your updates when you run the below in Test Search, wait 3-5 minutes and try again in case there’s an unexpected delay in the re-indexing of the data. If you’re still seeing issues, reach out to the  Community  for assistance.

Step 1: Add FAQs Vertical

  1. Navigate to Search > Brand Search > Edit as JSON. This is your JSON file that has your full Search configuration. Click into the file and search (CTRL+F) for “faqs”. You’ll notice that there are no matches – this is because you don’t have a vertical set up for FAQs yet! Feel free to scroll through this file to get familiar before we switch over to the UI to create your vertical.
  2. Navigate to Search > Brand Search > Verticals under the Configuration section. Click + Add Vertical.
  3. Create an FAQs vertical:
    • Vertical Name: FAQs
    • Vertical Key: faqs
    • Entity Type: FAQ
    • Then click Save and Configure.
  4. Some searchable fields were added to the FAQs vertical by default. Review them and make sure the below is true. If it’s not, click + Add / Update Fields under the relevant section to modify.
    • Inferred Filter includes Entity Type
    • Semantic Search includes Question
    • Keyword Search includes Keywords
  5. Click Save.
  6. Search for “FAQs” and “gift cards” in Test Search. You’re now getting results. Navigate to the Edit as JSON screen and search for “faqs” like you did in step 2. You should now see your FAQs vertical in the verticals object with the searchable fields specified above.

Step 2: Add Saved Filters for the All Verticals

Check out the Saved Filters module in the Content track if you need a refresher on saved filters.

FAQs Vertical

  1. You want to add a saved filter for FAQs, but first you need to set up your Content. Add a custom field that is type Yes/No, is called “Active On Search”, has an API name of c_activeOnSearch, and is available to the FAQ entity type. Check out the Add Custom Field help article if you need help.
  2. Bulk edit all of your FAQs so that “Active on Search” is set to “Yes”. Check out the Edit Entities in Bulk help article if you need help.
  3. Add a saved filter for FAQs called “FAQs on Search” with the following criteria. Check out the Apply a Filter help article if you need help.
    • Entity Type is FAQs
    • Fields with Data includes Answer (The Fields with Data filter allows you to filter to only those entities that have the specified field(s) filled out with content. This filter is making sure that only FAQs that have an answer will appear in search results.)
    • Active on Search = Yes (This flag allows you to vet and select the entities you want to surface.)
  4. Now that you have the Content set up, add the saved filter you just created to the FAQs vertical in your search configuration.
    1. Navigate to Search > Brand Search > Verticals.
    2. Select the FAQs vertical and click on the Settings tab.
    3. For the Saved Filters property, click the dropdown and select the “FAQs on Search” saved filter.
  5. Click Save.

    Restaurants Vertical

  6. In the Search configuration for the Restaurants vertical, add the existing saved filter for “Open Restaurants” that you created in the Content track. This time, edit it in the JSON editor. Find the existing Restaurants vertical object and place the savedSearchId property can be placed anywhere inside. For example, it could look like this:

    "restaurants": {
      "name": "restaurant",
      "savedSearchId": "[[INSERT SAVED FILTER ID]]",
      ...
    }

    Make sure to copy the right saved filter ID from Content > Configuration > Saved Filters screen and that you surround the ID with quotes and include a comma at the end. You can reference your FAQs vertical for the proper syntax.

  7. Click Save.

  8. In Test Search, search for “Tyler, TX” again. Notice the restaurant has been removed.

    Events Vertical

  9. In Content, create a saved filter for Events called “Events in the Future” with the following criteria:

    • Entity Type is Events
    • End Date/Time is in the future
  10. Add the saved filter you just created to the Events vertical under Settings. You can choose whether to use the UI or JSON editor.

  11. Click Save.

Step 3: Add Searchable Field for Restaurants Vertical

  1. Go to the entity with entity ID 42 and update the Promoting Events field to include the event called “Find that TacoMania!” (event-5).
  2. Add an inferred filter in the Restaurants vertical for the linked Events in the Promoting Events field. Remember that linked entity fields can index the name of the linked entities like this: c_fieldName.name or in this case c_promotingEvents.name.

    • To do this in the UI, click the dropdown in the breadcrumbs to switch to the Restaurants vertical. Then click on the Filters tab. Click on + Add / Update Searchable Fields in the inferred filter section and check off the c_promotingEvents.name field. Click Update.
    • To do this in the JSON editor, navigate to the Edit as JSON screen and scroll to your “restaurants” vertical object. In searchableFields, you should see fields like name, builtin.entityType, builtin.location, and mainPhone. Add c_promotingEvents.name with nlpFilter set to true. It should look like:

      "restaurants": {
        "entityTypes": [
          "restaurant"
        ],
        "name": "Restaurants",
        "searchableFields": {
          "builtin.entityType": {
            "nlpFilter": true
          },
          "builtin.hours": {
            "nlpFilter": true
          },
          "builtin.location": {
            "nlpFilter": true
          },
          "c_promotingEvents.name": {
            "nlpFilter": true
          },
          "keywords": {
            "phraseMatch": true
          },
          "name": {
            "textSearch": true
          }
        },
        "sortBys": [],
        "source": "YEXT"
      }
    • Click Save.

  3. In Test Search, run a search for “Find that TacoMania”. The restaurant shows up!

Step 4: Add Facets to the Restaurants Vertical

  1. In the Restaurants vertical, add the following fields as facets. Follow the instructions above to edit either in the UI or JSON.
    • Restaurant Features (c_restaurantFeatures)
    • Restaurant Type (c_restaurantType)
  2. Click Save.
  3. Navigate to Test Search and run a search for “restaurants”. Switch to the Restaurants tab. You’ll see the facets next to the results. Click on a couple to see how they narrow down results.

Step 5: Add Default Sorting to Events Vertical

We want to sort the events chronologically. To do so, we’ll sort on the Start (time.start) field. Since this is a subfield, it is not found in the UI and must be added via the JSON editor. To do this in the JSON editor, navigate to the Edit as JSON screen and scroll to your “events” vertical object.

  1. Since we’re adding field sort via the JSON editor, you first need to add the field as sortable to searchable fields. In the Events vertical searchable fields object, add “Start” (time.start) as sortable. It should look like:

        "events": {
          "searchableFields": {
            "time.start": {
              "sortable": true
            }
          }
        },
  2. Update the default sort order: in the sortBys array, add two objects, one for each rule. It should look like:

        "events": {
          "sortBys": [
            {
              "type": "RELEVANCE"
            },
            {
              "type": "FIELD",
              "field": "time.start",
              "direction": "ASC"
            }
          ]
        },
  3. Click Save.

  4. In Test Search, run a search for “events” again. Note the restaurants are listed chronologically now.

Great, you’ve set up the Restaurants, FAQs, and Events verticals for your Brand Search!

Module Assessment
+<% util.points %> points
loading
Weekly Challenge Streak Weekly Challenge Streak: <% util.streakWeekly %>
You must include a first name and last name in your profile to create challenge environments.
Challenge account expires in <% util.expirationHours > 24 ? Math.round((util.expirationHours * 1.0) / 24) : util.expirationHours %> <% util.expirationHours > 24 ? (Math.round((util.expirationHours * 1.0) / 24) == 1 ? 'day' : 'days') : (util.expirationHours == 1 ? 'hour' : 'hours') %>.
Challenge account has expired. Please create a new account.
Report Card
Add the FAQs vertical to the search config
Add the FAQs on Search saved filter to the FAQs vertical
Add the Open Restaurants saved filter to the Restaurants vertical
Add Events in the Future saved filter to the Events vertical
Add Promoting Events as a searchable field on the Restaurants vertical
Add searchable fields as facets to the Restaurants vertical in config
Add searchable fields as sortable to the Events vertical in config
Sort the Events vertical by relevance and Event Time in the config
Common Issues
Configuration changes not saved or showing a message that there are no changes? expand/collapse module

This is likely because you included an object that was not recognized and the Yext system is removing it from the config and saving any other changes.

If you’re adding something that is top-level, like the synonyms or autocomplete objects, make sure it’s not nested inside of a vertical. Conversely, if you’re adding a searchable field or a saved filter, make sure it is nested appropriately.

Having trouble with adding the linked entity name to searchable fields? expand/collapse module

Make sure you have the right syntax and is an NLP filter. It should look like this:

"c_promotingEvents.name": {
  "nlpFilter": true
},

Having trouble saving the saved filter ID to Search? expand/collapse module

There are two common causes:

  1. The syntax is off – the property is called “savedSearchId” (case sensitive) and the filter ID should be encased in quotations (the filter ID can be an alphanumeric string, it’s just that those created in the UI happen to be numeric)

  2. The filter is invalid. Make sure you’re copying a valid filter ID from account settings.

Previous Submissions
Attempt #<% submission.attemptNumber %>
<% submission.date %>
Score: <% submission.numericScore %>
Pending