jillesvangurp / kt-search

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

[FEAT] term boolean support #129

Closed cdekok closed 6 months ago

cdekok commented 8 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 8 months ago

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