Searchable Fields - Text Search, Semantic Text Search, Phrase Match | Yext Hitchhikers Platform
What You’ll Learn
In this section, you will learn:
- What Text Search, Semantic Text Search, and Phrase Match are
- Text Search Configuration and Use Cases
- Semantic Text Configuration and Use Cases
- Phrase Match Configuration and Use Cases
Overview
In the next few modules, you’ll learn about Searchable Fields and their use cases. In this unit, we’ll look at three searchable field types: text search, semantic text search, and phrase match. Searchable fields can be set either through the UI or directly in the JSON editor (JSON formatting provided below).
Text Search Configuration, Example, and Best Practices
Let’s walk through an example of how to configure Text Search in a Jobs Vertical.
- Example Vertical: Jobs
- Example Field: Name (
name
) - Example Field Type: Profile Field
Text Search allows each token of the query to be searched within the fields you specify. This is best for short text fields that might contain unstructured or varied data.
Take a look at the query below, “application for partner roles”:
In this example, the following tokens are parsed from the query:
- Application
- Partner
- Roles
Text Search on the name
field brings in mutliple roles across various departments. In this case, the following roles are returned:
- Partner Engineer
- Technical Partner Manager
- 2021 Partner Engineer, New Grad
- 2021 Associate Technical Partner Manager, New Grad
The user could be looking for any one of these “partner” jobs, and it’s not immediately clear which exact role he or she is looking for. Given the nature of the entity name
fields, in this specific Jobs case and in general (with varied, unstructured data and infinite values), it is a best practice to use Text Search on it.
You can also add the Text Search field via JSON within the searchableFields
object:
"searchableFields": {
"name": {
"textSearch": true
}
}
Semantic Text Search Configuration, Example, and Best Practices
Let’s walk through an example of how to configure Semantic Text Search in an FAQs Vertical. Semantic Text Search can also be activated for any other Entity Type, except for Location entities.
- Example Vertical: FAQs
- Example Field: Question (
question
) - Example Field Type: Profile Field
This Searchable Field type turns on our Semantic Text Search algorithm (learn more about this in our Search Algorithm module ), which will match a user’s query to an FAQ that is semantically similar.
If a user query and FAQ Question are semantically similar, it means that they are “close” in meaning. Let’s take for example a user query and FAQ question (within the Knowledge Graph) that Turtlehead Tacos might receive regarding its online delivery:
- User Query: send back my food
- KG FAQ Question: Can I return my order?
By simply using a Text Search searchable field, the algorithm is looking for tokens (keywords) on a given field (FAQ question, in this case) and attempting to return the most revelant results. Let’s drill down to the relevant keywords in these two queries:
- Can I return my order?
- Send back my food
The keywords return and order are not similar to send, back, and food when purely looking at the words themselves and ignoring semantics. Therefore, the query “send back my food” does not return the “Can I return my order?” FAQ when using a Text Search searchable field:
Semantically, the query and FAQ question are very similar. Both “returning an order” and “send back my food” mean that a customer wants to return something (in this case, food) to the brand. Ideally, the query “send back my food” returns the “Can I return my order?” FAQ from the Knowledge Graph.
This can be made possible by using Semantic Text Search. We embed the search query and FAQ in vector space and use an algorithm to determine the most relevant FAQ. To illustrate the impact of Semantic Text Search, let’s switch the FAQ Question field from its previous Text Search configuration to Semantic Text Search:
The algorithm now understands that “send back my food” and “can I return my order?” are semantically similar, and the most relevant FAQ is returning first in the FAQ results.
You can add also turn on Semantic Text Search via JSON within the searchableFields
object:
"searchableFields": {
"question": {
"semanticTextSearch": true
}
}
Phrase Match Configuration, Example, and Best Practices
Let’s walk through an example of how to configure Phrase Match in an FAQs Vertical.
- Example Vertical: FAQs
- Example Field: Keywords (
keywords
) - Example Field Type: Profile Field
Phrase Match allows an entity to be surfaced only when there is an exact phrase match contained in the query. In this scenario, we have a keywords field and will only trigger a result if there is an exact phrase match contained within the query.
Here is an FAQ with “hours” populated in its keywords field:
The query “what are your hours
”, in this example, exactly matches the hours
keyword stored on the FAQ entity’s keywords field, thereby returning it as a result:
Notice that if we slightly adjust the query, in this case “what are your opening times”, the FAQ no longer returns because the phrase hours
is not contained in the query:
The FAQ will only be returned if the word (or “phrase”) hours
is contained in the user’s query.
You can add also enable phrase match via JSON within the searchableFields
object:
"searchableFields": {
"keywords": {
"phraseMatch": true
}
}