Skip to content

Instantly share code, notes, and snippets.

@rugyoga
Last active July 21, 2022 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rugyoga/6a742d8716c980be2515ad2c4f817c11 to your computer and use it in GitHub Desktop.
Save rugyoga/6a742d8716c980be2515ad2c4f817c11 to your computer and use it in GitHub Desktop.
Create the initial ES Query based on PIT ID and a ES Query
@spec initial(PIT.pit_t(), ES.query_t()) :: ES.query_t()
def initial(pit, query) do
%{
query: query,
pit: %{id: pit, keep_alive: PIT.expiration()},
size: ES.max_results(),
sort: %{"_shard_doc" => "desc"}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment