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: |-
358358 })
359359search_parameter_guide_show_ranking_score_1 : |-
360360 client.index('movies').search('dragon', {
361- 'showRankingScore': true
361+ 'showRankingScore': True
362362 })
363363search_parameter_guide_show_ranking_score_details_1 : |-
364364 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):
473473 assert response ["hits" ][0 ]["_rankingScoreDetails" ]["words" ]["score" ] == 1
474474
475475
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+
476489@pytest .mark .usefixtures ("enable_vector_search" )
477490def test_vector_search (index_with_documents_and_vectors ):
478491 response = index_with_documents_and_vectors ().search (
You can’t perform that action at this time.
0 commit comments