Skip to content

Fix test_scorer (search) #2920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/test_asyncio/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,9 +1045,9 @@ async def test_scorer(decoded_r: redis.Redis):
res = await (
decoded_r.ft().search(Query("quick").scorer("TFIDF.DOCNORM").with_scores())
)
assert 0.1111111111111111 == res.docs[0].score
assert 0.14285714285714285 == res.docs[0].score
res = await decoded_r.ft().search(Query("quick").scorer("BM25").with_scores())
assert 0.17699114465425977 == res.docs[0].score
assert 0.22471909420069797 == res.docs[0].score
res = await decoded_r.ft().search(Query("quick").scorer("DISMAX").with_scores())
assert 2.0 == res.docs[0].score
res = await decoded_r.ft().search(
Expand All @@ -1066,9 +1066,9 @@ async def test_scorer(decoded_r: redis.Redis):
res = await decoded_r.ft().search(
Query("quick").scorer("TFIDF.DOCNORM").with_scores()
)
assert 0.1111111111111111 == res["results"][0]["score"]
assert 0.14285714285714285 == res["results"][0]["score"]
res = await decoded_r.ft().search(Query("quick").scorer("BM25").with_scores())
assert 0.17699114465425977 == res["results"][0]["score"]
assert 0.22471909420069797 == res["results"][0]["score"]
res = await decoded_r.ft().search(Query("quick").scorer("DISMAX").with_scores())
assert 2.0 == res["results"][0]["score"]
res = await decoded_r.ft().search(
Expand Down
8 changes: 4 additions & 4 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,9 @@ def test_scorer(client):
res = client.ft().search(Query("quick").scorer("TFIDF").with_scores())
assert 1.0 == res.docs[0].score
res = client.ft().search(Query("quick").scorer("TFIDF.DOCNORM").with_scores())
assert 0.1111111111111111 == res.docs[0].score
assert 0.14285714285714285 == res.docs[0].score
res = client.ft().search(Query("quick").scorer("BM25").with_scores())
assert 0.17699114465425977 == res.docs[0].score
assert 0.22471909420069797 == res.docs[0].score
res = client.ft().search(Query("quick").scorer("DISMAX").with_scores())
assert 2.0 == res.docs[0].score
res = client.ft().search(Query("quick").scorer("DOCSCORE").with_scores())
Expand All @@ -967,9 +967,9 @@ def test_scorer(client):
res = client.ft().search(Query("quick").scorer("TFIDF").with_scores())
assert 1.0 == res["results"][0]["score"]
res = client.ft().search(Query("quick").scorer("TFIDF.DOCNORM").with_scores())
assert 0.1111111111111111 == res["results"][0]["score"]
assert 0.14285714285714285 == res["results"][0]["score"]
res = client.ft().search(Query("quick").scorer("BM25").with_scores())
assert 0.17699114465425977 == res["results"][0]["score"]
assert 0.22471909420069797 == res["results"][0]["score"]
res = client.ft().search(Query("quick").scorer("DISMAX").with_scores())
assert 2.0 == res["results"][0]["score"]
res = client.ft().search(Query("quick").scorer("DOCSCORE").with_scores())
Expand Down