@@ -8,18 +8,25 @@ Learn how to combine different retrievers in these hands-on examples.
88==== Add example data
99
1010To 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----
1415PUT 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----
459466PUT 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 {
0 commit comments