jillesvangurp / kt-search

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

[FEAT] enable setting refresh_interval in createIndex #95

Closed Tyngstast closed 6 months ago

Tyngstast commented 7 months ago

Describe the enhancement

I want to enable setting refresh_interval in IndexSettings for createIndex.

More info: https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-refresh-interval-setting

Why is this needed?

It's relevant for performance optimizations.

Will you be able to help with a pull request?

Optional, but do let me know if you plan to do work.

jillesvangurp commented 7 months ago

I don't have all the parameters supported indeed but it's easy to go schema-less here and just manually update the underlying map:

client.createIndex("an-index") {
   settings {
      replicas=1
      shards=3
      this["refresh_interval"]=5
   }
}

If you have time to do a pull request, it's pretty easy to add this to the DSL. Not planning to do a lot of work on this soon but might eventually get around to this.

barbulescu commented 6 months ago

This can be closed as it was implemented in https://github.com/jillesvangurp/kt-search/pull/99 and https://github.com/jillesvangurp/kt-search/pull/100

jillesvangurp commented 6 months ago

Thanks again!

jillesvangurp commented 6 months ago

I created a release with your changes btw.