File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ typo_tolerance_guide_4: |-
358
358
})
359
359
search_parameter_guide_show_ranking_score_1 : |-
360
360
client.index('movies').search('dragon', {
361
- 'showRankingScore': true
361
+ 'showRankingScore': True
362
362
})
363
363
search_parameter_guide_show_ranking_score_details_1 : |-
364
364
client.index('movies').search('dragon', {
Original file line number Diff line number Diff line change @@ -473,6 +473,19 @@ def test_show_ranking_score_details(index_with_documents):
473
473
assert response ["hits" ][0 ]["_rankingScoreDetails" ]["words" ]["score" ] == 1
474
474
475
475
476
+ def test_show_ranking_score (index_with_documents ):
477
+ """Tests search with show ranking score"""
478
+ response = index_with_documents ().search (
479
+ "man loves" ,
480
+ {"showRankingScore" : True },
481
+ )
482
+
483
+ assert isinstance (response , dict )
484
+ assert len (response ["hits" ]) > 1
485
+ assert response ["hits" ][0 ]["_rankingScore" ] is not None
486
+ assert response ["hits" ][0 ]["_rankingScore" ] >= 0.9
487
+
488
+
476
489
@pytest .mark .usefixtures ("enable_vector_search" )
477
490
def test_vector_search (index_with_documents_and_vectors ):
478
491
response = index_with_documents_and_vectors ().search (
You can’t perform that action at this time.
0 commit comments