Direct Answers | Yext Hitchhikers Platform

What You’ll Learn

By the end of this unit, you will be able to:

  • Define the two types of direct answers
  • Explain when to use each type of direct answer
  • List the prediction mode options for field value direct answers and featured snippet direct answers

light bulb
Advanced Search Tier Feature
Direct answers are only available on the Advanced Search tier. Check out the Search Tiers reference doc to learn more about the features that are available in each tier.

Overview

Another feature you can set in the Search configuration is direct answers. Direct answers are meant to directly answer a user’s question by extracting information from results. There will not be a direct answer for every query, and you determine which fields and data are eligible for a direct answer.

Direct answers are different from the searchable fields you learned about in the last unit. Searchable fields are meant to control which entities and verticals are returned to the user. Direct answers, on the other hand, control how information is extracted from those results to show Direct Answers at the top of a results page.

There are two types of direct answers, which we’ll cover in this unit:

  • Field Value Direct Answers: come from structured data (you may see this referenced as just “direct answers”)
  • Featured Snippet Direct Answers: come from unstructured data (you may see this referenced as “featured snippets”)

If a direct answer is returned for a search query, it surfaces at the top of results, ahead of any vertical results. Additionally, the vertical it is pulled from is ranked higher than other verticals.

It is important to note that for any given search query, there can only be one direct answer, whether it’s a field value direct answer or featured snippet direct answer, per search, whether universal or vertical. Otherwise, it wouldn’t be a direct answer! Direct answers return on vertical search the same way they would on universal search.

To configure direct answers in the frontend, check out the Direct Answers Theme component reference doc and DirectAnswer React component reference doc.

Field Value Direct Answers

Field value direct answers respond to user questions directly using fields you designate as eligible, such as a doctor’s phone number or a location’s address. These direct answers come from structured data. The entire value of the eligible field is returned as the direct answer.

book
Note
Field value direct answers must be pulled from the first vertical. If you’re not seeing a direct answer you expected, first make sure the vertical is returned first.

In the example below, we have enabled the mainPhone field as a field value direct answer eligible field for the Restaurants vertical. As you can see in the test search on the right, running a search for “phone number for new york location” returns the phone number as a direct answer before returning the Restaurants vertical with the relevant entity. This is a quick way for users to get the answers they want directly.

field value direct answer

Prediction Mode

Field value direct answers have what is called a Prediction Mode, which allows you to configure how assertive the algorithm is when surfacing a field value direct answer. There are three modes:

  • Field Name (Aggressive): The algorithm will show a direct answer whenever it detects an eligible field name, regardless of which entities are returned, if any. This is recommended for single-location businesses.
    • For example, if you are a single location business and you want to surface field value direct answers for queries like “what are your hours?” (where the query does not mention or resolve to a single entity), this will show a direct answer if it detects a populated hours field, regardless of which entities are returned, if any.
  • Classifier (Default): The algorithm uses an NLP classifier to decide whether the user is seeking a direct answer.
  • One Entity (Conservative): The algorithm shows a direct answer only if the search returns one entity and a field name is detected.
    • In the “phone number for new york location” example above, a direct answer would still have been returned if the prediction mode was set to one entity because there is only one location in New York. If there were more locations in New York, more restaurant entities would be returned for this query, and thus a direct answer would not be returned. The user must then narrow down the query to specify which New York location they’re looking for to return a direct answer.

Edit via the Platform UI

To configure direct answers in the UI, navigate to the Verticals screen, choose the desired vertical, and click on the Settings tab. Within the Advanced box, there is a row for each type of direct answer.

For field value direct answers specifically, you can set the eligible fields and the prediction mode. To add an eligible field, click + Add / Update Fields and select the desired fields in the dropdown. Once there is at least one eligible field added, the dropdown for the prediction mode will appear for you to set.

Edit via the JSON Editor

In the JSON instance of the Search configuration, fields are referenced by their API name (check out the View Field API Name help article to learn how to find this). To set a field as eligible for field value direct answers, specify the API Name of the field you are setting.

The JSON for the same Restaurants vertical field value direct answers configuration above would look like the following:

  "verticals": {
    "restaurants": {
      "directAnswers": {
        "fieldValues": {
          "eligibleFields": [
            "mainPhone"
          ],
          "predictionMode": "CLASSIFIER"
        }
      },
    }
  },

Check out the Search Config - Verticals reference doc to learn more about the direct answers properties.

Featured snippets extract answers to users’ questions from any fields for which the searchable field type document search is activated (learn more in the Searchable and Display Fields unit). These direct answers come from unstructured data such as blogs, help articles, or people bios. Since these types of fields tend to contain long form content, featured snippets will extract out the snippet that best responds to the query.

Users are able to train the algorithm through experience training (see the Experience Training unit ) by accepting, modifying, or rejecting algorithm-generated featured snippets. Rejected featured snippets will no longer surface in results.

book
Note
While all verticals may produce featured snippets, the vertical that produced the displayed featured snippet will be pushed to the top of results. That means if you accept a featured snippet through experience training, vertical ranking may be overridden to display the vertical that produced the featured snippet first. If you don’t want a featured snippet producing vertical to rank higher, reject that featured snippet.

In the example below, document search is enabled for the Body field of the Help Articles vertical. The test search on the right for “where to redeem gift cards” returns a featured snippet with the answer from the relevant help article.

featured snippet direct answer

Prediction Mode

Featured snippets also have a Prediction Mode setting, which lets you choose whether they need to be approved in experience training to be shown to end users. There are two modes:

  • Approve Only: The algorithm only shows featured snippets once they are explicitly approved in experience training.
  • Allow All (Default): This will show all featured snippets produced by the algorithm. The featured snippets don’t need to be approved in order to appear in the experience. With this prediction mode, users can still train the algorithm by rejecting featured snippets they no longer want to show.

Edit via the Platform UI

To configure direct answers in the UI, navigate to the Verticals screen, choose the desired vertical, and click on the Settings tab. Within the Advanced box, there is a section for each type of direct answer.

For featured snippet direct answers specifically, you are only able to configure the prediction mode. Set this in the given dropdown. Remember to add a field to the document search algorithm first.

Edit via the JSON Editor

To set a field as eligible for featured snippets, add the field to the searchableFields object and set documentSearch to true.

Then under the directAnswers object, you can set the predictionMode value for featuredSnippets. Note that if you have not yet edited the prediction mode, the directAnswers object will not appear in the JSON file, in which case it is set to the default ALLOW_ALL.

The JSON for the same Help Articles vertical field value direct answers configuration above would look like the following:

  "verticals": {
    "help_articles": {
      "directAnswers": {
        "featuredSnippets": {
          "predictionMode": "ALLOW_ALL"
        }
      },
    }
  },

Check out the Search Config - Verticals reference doc to learn more about the direct answers properties.

unit Quiz
+20 points
Daily Quiz Streak Daily Quiz Streak: 0
Quiz Accuracy Streak Quiz Accuracy Streak: 0
    Error Success Question 1 of 3

    What is the difference between field value direct answers and featured snippet direct answers?

    Error Success Question 2 of 3

    Which fields may be good candidates for field value direct answers on a Products vertical? (select all that apply)

    Error Success Question 3 of 3

    As a brand in a highly regulated industry, you want to validate all featured snippets before they appear on your Search results. Which prediction mode should you use?

    Wahoo - you did it! 🙌

    You've already completed this quiz, so you can't earn more points.You completed this quiz in 1 attempt and earned 0 points! Feel free to review your answers and move on when you're ready.
1st attempt
0 incorrect
Feedback