Skip to content

Commit

Permalink
api: increase batch size of search to 1000.
Browse files Browse the repository at this point in the history
We are not paginating at this point.
  • Loading branch information
jone committed Sep 7, 2024
1 parent fa5df6c commit 00d4f2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/app/elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def search_documents(self, longitude: float, latitude: float, radius: str) -> li
"must": {"match_all": {}},
"filter": {"geo_distance": {"distance": radius, "coordinates": {"lon": longitude, "lat": latitude}}},
}
}
},
)
hits = response["hits"]["hits"]
return list(map(itemgetter("_source"), hits))

def search(self, query: dict) -> ObjectApiResponse:
"""Search for documents in the index, returning the elastic search response."""
return self.connection.search(index=self.index_name, query=query)
return self.connection.search(index=self.index_name, query=query, size=1000)

def index(self, document: dict) -> None:
"""Add a document to the elasticsearch index."""
Expand Down

0 comments on commit 00d4f2b

Please sign in to comment.