Skip to content

Commit 99a8396

Browse files
Update documentation to highlight that copy_to is not required (#436)
1 parent eaa5796 commit 99a8396

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

notebooks/search/09-semantic-text.ipynb

+5-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@
400400
"source": [
401401
"Notice how we configured the mappings. We defined `plot_semantic` as a `semantic_text` field.\n",
402402
"The `inference_id` parameter defines the inference endpoint that is used to generate the embeddings for the field.\n",
403-
"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."
403+
"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",
404+
"\n",
405+
"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."
404406
]
405407
},
406408
{
@@ -613,6 +615,8 @@
613615
"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",
614616
"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",
615617
"\n",
618+
"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",
619+
"\n",
616620
"Note the `boost` parameters applied to the `multi_match` and `semantic` queries.\n",
617621
"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",
618622
"This involves consideration of a few factors, including:\n",

0 commit comments

Comments
 (0)