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] term boolean support #129

Closed cdekok closed 1 month ago

cdekok commented 3 months ago

Describe the enhancement

Add support to the term to accept a boolean

term(query.field, true)

Why is this needed?

Currently it only accepts strings which is a bit awkward to use when dealing with boolean values

How do you think it should be done?

Adding an additional dsl like.

fun QueryClauses.term(
    field: String,
    value: Boolean,
    block: (TermQueryConfig.() -> Unit)? = null
)

Will you be able to help with a pull request?

Yes

jillesvangurp commented 3 months ago

Sounds good, feel free to add this with a small PR.