Created
July 19, 2022 22:25
-
-
Save rugyoga/a94f6e3cf16b76031df82fd97b380e1d to your computer and use it in GitHub Desktop.
Update the ES query using the most recent result set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@spec update(ES.query_t(), ES.response_t()) :: ES.query_t() | |
def update(query, %Req.Response{body: %{"hits" => %{"hits" => hits}}, status: 200}) do | |
Map.put(query, :search_after, List.last(hits)["sort"]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment