Module Assessment | Yext Hitchhikers Platform
Background
People have been asking if fan-favorite specials like the “Golden Taco” are being served during every Turtlehead Tacos hosted event. You have already helped them find which restaurant locations are holding specific events, but you decide you want to make the event specials searchable on the restaurant and events vertical. We’ve already added event special entities and added them to the related events for you. You will:
- Add event specials as a searchable field to the Events vertical.
- Add event specials as a searchable field on the Restaurants vertical using multihop logic.
- Add event specials as a facet on the Restaurants vertical using multihop logic.
- Customize the facet for events specials on the Restaurants vertical.
Your Challenge
Navigate to Search > answers > Home. Test out the query “Golden Taco” in your full-screen Test Search. Notice that the Events where that item is served like “Taco Slam” or “Find that TacoMania” don’t appear in the results.
Navigate to Search > answers > Verticals. Add a searchable field in the Events vertical for the linked Specials and set it as an NLP filter. Remember that linked entity fields can index any field of the linked entities using dot notation in the format
c_relationshipField.fieldName
or in this casec_ eventSpecials.name
.- To use the UI to do this, click on Verticals and click the dropdown to view the Events vertical. You can then click on “+Add / Update Searchable Fields”, find the c_eventSpecials.name field, and then add an NLP Filter.
- If you want to use the Code Editor, click on “Edit as JSON” and scroll to your “events” vertical object. In searchableFields, you should see fields like name, builtin.entityType, builtin.location and mainPhone. Add
c_ eventSpecials.name
with NLP Filter set to true.
Run a test search for “Golden Taco” on the right side and you will now see Events appear in the results.
Now let’s add a searchable field with multihop! Add a searchable field in the Restaurants vertical for the linked Events’ Specials Name field and set it as an NLP filter and facet. In this case, you need to use multihop dot notation which will allow Search to pull field data from a linked entity of a linked entity. Use the format
c_relationshipField1.c_relationshipField2.fieldName
or in this casec_promotingEvents.c_eventSpecials.name
.- You will need to use the Code Editor for searchable fields with multihop. Click on “Edit as 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.c_eventSpecials.name
with NLP Filter and Facet set to true.
- You will need to use the Code Editor for searchable fields with multihop. Click on “Edit as JSON” and scroll to your “restaurants” vertical object. In searchableFields, you should see fields like name, builtin.entityType, builtin.location and mainPhone. Add
Run “Golden Taco” again in Test Search and you will now see the NLP filter for that event special appear in the box underneath the Restaurants vertical header. You will also see results for locations serving that item (based on the events being held there).
Now let’s see how the frontend looks and customize the facet. Navigate to Pages > Turtlehead Taco Search > Deploys, go to the Code Editor, and click into the master branch. You should expect this to take a couple of minutes to load – in the background, it’s starting up a container for your development.
Click “View Live Preview” to open your preview in a new tab.
Go to the Restaurants vertical and view the filters. Filters are already set up to appear on the vertical, but you notice that the title for the new
c_promotingEvents.c_eventSpecials.name
facet is labeled as “Promoting Events Event Specials Name” (the combination of each hop). We want to clean that up.In the config > restaurants.json file, let’s customize how the
c_promotingEvents.c_eventSpecials.name
facet looks and behaves.- Change the label to “Featured Event Specials”.
Make the
c_promotingEvents.c_eventSpecials.name
field searchable:"fields": { "c_promotingEvents.c_eventSpecials.name": { "label": "Featured Event Specials", "searchable": true, "placeholderText": "Search our featured specials" } }
Use Live Preview to verify your updates.
Commit your code. Monitor the build and publish your page in staging. Confirm that your staging URL works as expected.