Hi folks, I'm working with Python client and would like to know if it is possible to do a search by target ids with BM25.
I have a 500k index and a list of ids that I would like to filter and at the same time obtain BM25 score.
doc_ids = ["1", "2", "3"]
# specify the query to retrieve the BM25 score
bm25_query = {"bool": {"filter": [{"terms": {"_id": doc_ids}}]}}
bm25_results = es.search(
index=idx_name,
size=topk,
request_timeout=30,
query=bm25_query,
explain=True
)
How do I get the score without getting 0.0 or 1.0?
for hit in bm25_results["hits"]["hits"]:
print(f"Document BM25 Score: {hit['_score']}")