File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,10 @@ search_parameter_guide_show_ranking_score_1: |-
360
360
client.index('movies').search('dragon', {
361
361
'showRankingScore': true
362
362
})
363
+ search_parameter_guide_show_ranking_score_details_1 : |-
364
+ client.index('movies').search('dragon', {
365
+ 'showRankingScoreDetails': True
366
+ })
363
367
search_parameter_guide_attributes_to_search_on_1 : |-
364
368
client.index('movies').search('adventure', {
365
369
'attributesToSearchOn': ['overview']
Original file line number Diff line number Diff line change @@ -459,6 +459,20 @@ def test_attributes_to_search_on_search_no_match(index_with_documents):
459
459
assert response ["hits" ] == []
460
460
461
461
462
+ def test_show_ranking_score_details (index_with_documents ):
463
+ """Tests search with show ranking score details"""
464
+ response = index_with_documents ().search (
465
+ "man loves" ,
466
+ {"showRankingScoreDetails" : True },
467
+ )
468
+
469
+ assert isinstance (response , dict )
470
+ assert len (response ["hits" ]) > 1
471
+ assert response ["hits" ][0 ]["_rankingScoreDetails" ] is not None
472
+ assert response ["hits" ][0 ]["_rankingScoreDetails" ]["words" ] is not None
473
+ assert response ["hits" ][0 ]["_rankingScoreDetails" ]["words" ]["score" ] == 1
474
+
475
+
462
476
@pytest .mark .usefixtures ("enable_vector_search" )
463
477
def test_vector_search (index_with_documents_and_vectors ):
464
478
response = index_with_documents_and_vectors ().search (
You can’t perform that action at this time.
0 commit comments