Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion notebooks/search/09-semantic-text.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@
"source": [
"Notice how we configured the mappings. We defined `plot_semantic` as a `semantic_text` field.\n",
"The `inference_id` parameter defines the inference endpoint that is used to generate the embeddings for the field.\n",
"Then we configured the `plot` field to [copy its value](https://www.elastic.co/guide/en/elasticsearch/reference/current/copy-to.html) to the `plot_semantic` field."
"Then we configured the `plot` field to [copy its value](https://www.elastic.co/guide/en/elasticsearch/reference/current/copy-to.html) to the `plot_semantic` field.\n",
"\n",
"While the use of `copy_to` is not required to leverage semantic search it does enable use cases like hybrid search where semantic and lexical techniques are used together. The contents of the `plot` field are copied into the `plot_semantic` field which enables searches over both fields at once."
]
},
{
Expand Down Expand Up @@ -613,6 +615,8 @@
"These results demonstrate that the application of lexical search techniques can help focus the results, while retaining many of the advantages of semantic search.\n",
"In this example, the top search results are all still movies involving organized crime, but the `multi_match` query keeps the long tail shorter and focused on movies in the crime genre.\n",
"\n",
"Notice how we specify the `plot` field in the multi_match query. The content of this field is also contained in the semantic field `plot_semantic` due to the use of `copy_to` this allows the boolean query to consider both lexical and semantic similarity of the `plot` field.\n",
"\n",
"Note the `boost` parameters applied to the `multi_match` and `semantic` queries.\n",
"Combining lexical and semantic search techniques in a boolean query like this is called \"linear combination\" and when doing this, it is important to normalize the scores of the component queries.\n",
"This involves consideration of a few factors, including:\n",
Expand Down