Skip to content

Update documentation to highlight that copy_to is not required #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2025
Merged
Changes from all commits
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 `copy_to` is not required to use `semantic_text`, it enables use cases like hybrid search where semantic and lexical techniques are used together. We will cover a hybrid search example later in this notebook."
]
},
{
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",
"The `copy_to` parameter we defined in the mapping enables this query pattern. It ensures that the content provided for the `plot` field is indexed both lexically and semantically.\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