MINOR: make type optional in ES Response (#17832)

* MINOR: make type optional in ES Mixin

* make none as default

* pyformat
This commit is contained in:
Mayur Singal 2024-09-13 13:47:12 +05:30 committed by Pere Miquel Brull
parent 7efdd9b066
commit 05cb36f8db

View File

@ -46,7 +46,10 @@ class HitsModel(BaseModel):
"""Elasticsearch hits model"""
index: Annotated[str, Field(description="Index name", alias="_index")]
type: Annotated[str, Field(description="Type of the document", alias="_type")]
type: Annotated[
Optional[str],
Field(default=None, description="Type of the document", alias="_type"),
]
id: Annotated[str, Field(description="Document ID", alias="_id")]
score: Annotated[
Optional[float], Field(description="Score of the document", alias="_score")