jillesvangurp / kt-search

Multi platform kotlin client for Elasticsearch & Opensearch with easily extendable Kotlin DSLs for queries, mappings, bulk, and more.
MIT License
107 stars 23 forks source link

[BUG] SearchClient fails to delete scroll due to incorrect request path #93

Closed artemmukhin closed 10 months ago

artemmukhin commented 10 months ago

Describe the bug

SearchClient.deleteScroll method sends a DELETE request to an incorrect path: /scroll/<id> instead of /_search/scroll/<id> (see docs).

This also affects SearchClient.scroll(response: SearchResponse), which is expected to delete the scroll at the end by using SearchClient.deleteScroll.

To Reproduce

  1. Call SearchClient.deleteScroll(id)
  2. Call SearchClient.scroll(id).

Expected: 404: No search context found for id Actual: the next batch of search results is returned

Will you be able to help with a pull request?

I am going to open a PR that fixes the SearchClient.deleteScroll implementation right away.

jillesvangurp commented 10 months ago

Thanks for this! Somehow this slipped through. I think searchAfter is recommended now, which is what I mostly use.