Skip to content

Commit 8cf7dab

Browse files
authored
Fix elasticsearch result ids returning as strings (#487)
1 parent d29038f commit 8cf7dab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nlp/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def search(self, query: str, k=10) -> SearchResults:
179179
body={"query": {"multi_match": {"query": query, "fields": ["text"], "type": "cross_fields"}}, "size": k},
180180
)
181181
hits = response["hits"]["hits"]
182-
return SearchResults([hit["_score"] for hit in hits], [hit["_id"] for hit in hits])
182+
return SearchResults([hit["_score"] for hit in hits], [int(hit["_id"]) for hit in hits])
183183

184184

185185
class FaissIndex(BaseIndex):

0 commit comments

Comments
 (0)