Module Assessment | Yext Hitchhikers Platform
Background
You know that people are always asking about things like gift cards, which is why you featured the FAQs on the landing pages for the restaurants. You want to make sure you can answer those same questions in Search as well so you decide to add the FAQ vertical to your config.
You also just heard that the restaurant in Tyler, TX (ID 35) is now closed. You remember how much Marty the CEO gets upset if diners show up to a location when it’s closed. You will make sure it’s marked as closed in Knowledge Graph and start using a saved search for Restaurants vertical as well.
Finally, you want to make sure that when a user searches for an event that is promoted by a specific restaurant, you surface those restaurants in the results. You’ll do this by adding the Promoting Events field on restaurants to searchable fields.
Your Challenge
Navigate to Search > answers > Home. Test out a few queries in your full screen Test Search to see what the results are like:
- Run a search for “faqs” and “gift cards”. Note how nothing is returned.
- Run a search for “Tyler, TX”. Note that the restaurant is still returning as open but it’s permanently closed which is a terrible customer experience!
- 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.
You’ll fix all of this in this challenge.
Click “Edit as JSON” in the navigation. This is your JSON file that has your full Search Configuration. Click into the file and ctrl+F for “faqs”. You’ll notice that there’s nothing returned – 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.
Click on “Verticals” in the Configuration section in the left navigation. Click the dropdown at the top (where it says “Settings for:“) and click to “+Add Vertical”.
Select “FAQs” and click “Add Vertical” to add your FAQ vertical. You’ll be returned to the Search Configuration UI control page and you should see that Entity Type, Question, and Keywords were added to your experience by default.
- Make sure the verticalKey is “faqs” in “Additional Vertical Settings”
- Make sure the name is “FAQs” in “Additional Vertical Settings”
Review your Searchable Fields for your FAQ vertical. Make sure the below is true. If it’s not, click “+Add / Update Fields” to modify.
- Entity Type (builtin.entityType) is set to NLP Filter
- Question is set to Semantic Text Search
- Keywords is set to Text Search
Click Save.
Try searching for “FAQs” in your Test Search–either the full screen version on the Experience Home page or the right panel in your Configuration section. You should be able to see the NLP filter appear underneath the vertical header. Click back into the “Edit as JSON” view 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.
You want to add a saved filter for the FAQs, but first add a custom field on the FAQ type called “Active On Answers” that is type Yes/No and has an API name of
c_activeOnAnswers
.Bulk edit all of your FAQs so that “Active on Answers” is set to “Yes”.
In Knowledge Graph, add a saved filter for FAQs called “FAQs on Answers” and make sure it includes:
Entity Type
includes FAQFields with Data
includes Answer fieldActive on Answers
= Yes
Not sure what Fields with Data means or can’t remember how to add a Saved Filter? This was covered in the Saved Filters module in Knowledge Graph in this unit . It allows you to filter to only those entities that have the specified field(s) filled out with content. Similarly, the Fields without Data filter allows you to filter to entities that don’t have the specified field or fields filled out. This filter is making sure that only FAQs that have an answer will appear in search results.
Add the Saved Filter you just created to the FAQ vertical in your search configuration (in “Additional Vertical Settings”).
Save the configuration.
Go to Entity ID 35 (the restaurant in Tyler, TX that’s now closed) and make the following data changes:
- Change the Closed field to “Yes”
- Update Business Hours to be closed on all days
- Update the Name field to “Turtlehead Tacos - Closed”
Add the existing saved filter for “Open Restaurants” that you created in the Knowledge Graph track to the Restaurants vertical in the Search configuration. This time, you can choose whether you want to add the Saved Filter using the Search Configuration UI or the JSON Code Editor. If you enjoy a challenge, we recommend trying the Code Editor.
If you go the Code Editor route, the savedSearchId property can be placed anywhere under the Restaurant vertical object. For example, it could look like this:
{ "restaurants": { "name": "restaurant", "savedSearchId": "<INSERT SAVED FILTER ID>", "searchableFields": { . . } } }
Make sure that the copy the right Saved Filter ID from Knowledge Graph > Configuration > Saved Filters 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.
Save your change and make sure it saves properly. If you are having any issues, make sure you have the right quotes and commas for the JSON syntax and that you’re using a valid Saved Filter ID.
Go to Entity ID 42 and update the Promoting Events field to include the event called “Find that TacoMania!” (event-5).
Add a searchable field in the Restaurants vertical for the linked Events in the Promoting Events field as an NLP filter. Remember that linked entity fields can index the name of the linked entities like this:
c_fieldName.name
or in this casec_promotingEvents.name
.To use the UI to do this, click on Verticals and click the dropdown to view the Restaurants vertical. You can then click on “+Add / Update Searchable Fields” and find the
c_promotingEvents.name
field.If you want to use the Code Editor, click on “Edit in JSON” 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 NLP Filter set to true.
Test your changes by running the queries again in Test Search:
- Run a search for “faqs” and “gift cards”. Now you’re getting results!
- Run a search for “Tyler, TX”. The restaurant has been removed!
- Run a search for “Find that TacoMania”. The restaurant shows up!
Note: If you’re not seeing your updates, wait 3-5 minutes in case there’s an unexpected or rare delay in the re-indexing of the data. If you’re still seeing issues, reach out to the Community for assistance.
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.
Make sure you have the right syntax and is an NLP filter. It should look like this:
"c_promotingEvents.name": {
"nlpFilter": true
},
There are two common causes:
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)
The filter is invalid. Make sure you’re copying a valid filter ID from account settings.