Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,25 @@ Learn how to combine different retrievers in these hands-on examples.
==== Add example data

To begin with, lets create the `retrievers_example` index, and add some documents to it.
We will set `number_of_shards=1` for our examples to ensure consistent and reproducible ordering.

[source,console]
----
PUT retrievers_example
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"properties": {
"vector": {
"type": "dense_vector",
"dims": 3,
"similarity": "l2_norm",
"index": true
"index": true,
"index_options": {
"type": "flat"
}
},
"text": {
"type": "text"
Expand Down Expand Up @@ -458,6 +465,9 @@ and index a couple of documents.
----
PUT retrievers_example_nested
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"properties": {
"nested_field": {
Expand All @@ -470,7 +480,10 @@ PUT retrievers_example_nested
"type": "dense_vector",
"dims": 3,
"similarity": "l2_norm",
"index": true
"index": true,
"index_options": {
"type": "flat"
}
}
}
},
Expand Down Expand Up @@ -639,7 +652,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
"value": 3,
"relation": "eq"
},
"max_score": 0.44353113,
"max_score": 0.44444445,
"hits": [
{
"_index": "retrievers_example_nested",
Expand All @@ -648,7 +661,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
"field": "nested_field",
"offset": 2
},
"_score": 0.44353113,
"_score": 0.44444445,
"fields": {
"nested_field": [
{
Expand All @@ -666,7 +679,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
"field": "nested_field",
"offset": 1
},
"_score": 0.26567122,
"_score": 0.21301977,
"fields": {
"nested_field": [
{
Expand All @@ -684,7 +697,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
"field": "nested_field",
"offset": 0
},
"_score": 0.18478848,
"_score": 0.16889325,
"fields": {
"nested_field": [
{
Expand Down Expand Up @@ -716,7 +729,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
"value": 1,
"relation": "eq"
},
"max_score": 0.32002488,
"max_score": 0.31715825,
"hits": [
{
"_index": "retrievers_example_nested",
Expand All @@ -725,7 +738,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
"field": "nested_field",
"offset": 0
},
"_score": 0.32002488,
"_score": 0.31715825,
"fields": {
"nested_field": [
{
Expand Down
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/118914
- class: org.elasticsearch.xpack.security.authc.ldap.ActiveDirectoryRunAsIT
issue: https://github.com/elastic/elasticsearch/issues/115727
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
method: test {yaml=reference/search/search-your-data/retrievers-examples/line_98}
issue: https://github.com/elastic/elasticsearch/issues/119155
- class: org.elasticsearch.xpack.esql.action.EsqlNodeFailureIT
method: testFailureLoadingFields
issue: https://github.com/elastic/elasticsearch/issues/118000
Expand Down