Skip to content

Commit 3e6b8bf

Browse files
authored
Fix for rrf documentation test using a knn retriever (#120112)
1 parent 1d9acc1 commit 3e6b8bf

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

docs/reference/search/search-your-data/retrievers-examples.asciidoc

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,25 @@ Learn how to combine different retrievers in these hands-on examples.
88
==== Add example data
99

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

1213
[source,console]
1314
----
1415
PUT retrievers_example
1516
{
17+
"settings": {
18+
"number_of_shards": 1
19+
},
1620
"mappings": {
1721
"properties": {
1822
"vector": {
1923
"type": "dense_vector",
2024
"dims": 3,
2125
"similarity": "l2_norm",
22-
"index": true
26+
"index": true,
27+
"index_options": {
28+
"type": "flat"
29+
}
2330
},
2431
"text": {
2532
"type": "text"
@@ -458,6 +465,9 @@ and index a couple of documents.
458465
----
459466
PUT retrievers_example_nested
460467
{
468+
"settings": {
469+
"number_of_shards": 1
470+
},
461471
"mappings": {
462472
"properties": {
463473
"nested_field": {
@@ -470,7 +480,10 @@ PUT retrievers_example_nested
470480
"type": "dense_vector",
471481
"dims": 3,
472482
"similarity": "l2_norm",
473-
"index": true
483+
"index": true,
484+
"index_options": {
485+
"type": "flat"
486+
}
474487
}
475488
}
476489
},
@@ -639,7 +652,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
639652
"value": 3,
640653
"relation": "eq"
641654
},
642-
"max_score": 0.44353113,
655+
"max_score": 0.44444445,
643656
"hits": [
644657
{
645658
"_index": "retrievers_example_nested",
@@ -648,7 +661,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
648661
"field": "nested_field",
649662
"offset": 2
650663
},
651-
"_score": 0.44353113,
664+
"_score": 0.44444445,
652665
"fields": {
653666
"nested_field": [
654667
{
@@ -666,7 +679,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
666679
"field": "nested_field",
667680
"offset": 1
668681
},
669-
"_score": 0.26567122,
682+
"_score": 0.21301977,
670683
"fields": {
671684
"nested_field": [
672685
{
@@ -684,7 +697,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
684697
"field": "nested_field",
685698
"offset": 0
686699
},
687-
"_score": 0.18478848,
700+
"_score": 0.16889325,
688701
"fields": {
689702
"nested_field": [
690703
{
@@ -716,7 +729,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
716729
"value": 1,
717730
"relation": "eq"
718731
},
719-
"max_score": 0.32002488,
732+
"max_score": 0.31715825,
720733
"hits": [
721734
{
722735
"_index": "retrievers_example_nested",
@@ -725,7 +738,7 @@ This would propagate the `inner_hits` defined for the `knn` query to the `rrf` r
725738
"field": "nested_field",
726739
"offset": 0
727740
},
728-
"_score": 0.32002488,
741+
"_score": 0.31715825,
729742
"fields": {
730743
"nested_field": [
731744
{

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ tests:
189189
issue: https://github.com/elastic/elasticsearch/issues/118914
190190
- class: org.elasticsearch.xpack.security.authc.ldap.ActiveDirectoryRunAsIT
191191
issue: https://github.com/elastic/elasticsearch/issues/115727
192-
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
193-
method: test {yaml=reference/search/search-your-data/retrievers-examples/line_98}
194-
issue: https://github.com/elastic/elasticsearch/issues/119155
195192
- class: org.elasticsearch.xpack.esql.action.EsqlNodeFailureIT
196193
method: testFailureLoadingFields
197194
issue: https://github.com/elastic/elasticsearch/issues/118000

0 commit comments

Comments
 (0)