KT Search - a kotlin multi-platform library that provides client functionality for Elasticsearch and Opensearch

Related tags

SearchView kt-search
Overview

KT Search Client

CI-gradle-build

KT Search is a kotlin multi-platform library that provides client functionality for Elasticsearch and Opensearch.

It builds on other multi platform libraries such as ktor and kotlinx-serialization. Once finished, this will be the most convenient way to use opensearch and elasticsearch from Kotlin on any platform where Kotlin compiles.

This project started as a full rewrite of my es-kotlin-client project necessitated by the deprecation of Elastic's RestHighLevelClient and the Opensearch fork created by Amazon. Both Elasticsearch and Opensearch share the same REST API; however their Java clients are increasingly incompatible and in any case awkward to use from Kotlin. Kt-search, is a complete rewrite that removes the dependency on the Java clients entirely. It is also a Kotlin multi-platform library which makes it possible to use Elasticsearch or Opensearch from any platform. Es-kotlin-client lives on as the legacy-client module in this library and shares several of the other modules (e.g. the search dsls). So, you may use this as a migration path to the multi-platform client.

Module Overview

This repository contains several kotlin modules that each may be used independently.

Module Description
json-dsl A generalized abstraction for building your own Kotlin DSLs for JSON dialects; like for example the Elasticsearch query DSL.
search-dsls DSLs for search and mappings.
search-client Multiplatform REST client for Elasticsearch and Opensearch.
legacy-client The legacy client module provides essentially all the functionality of the old client. It utilizes the newly extracted search-dsl module.

Usage

println("Hits: ${results.total}") println(results.hits?.hits?.first()?.source) } }">
// we'll use a data class with kotlinx.serialization
// you can use whatever json framework for your documents
// of course
@Serializable
data class TestDocument(
  val name: String,
  val tags: List<String>? = null
) {
  fun json(pretty: Boolean = false): String {
    return if (pretty)
      DEFAULT_PRETTY_JSON.encodeToString(serializer(), this)
    else
      DEFAULT_JSON.encodeToString(serializer(), this)
  }
}

val client = SearchClient(
  // for now ktor client is the only supported client
  // but it's easy to provide alternate transports
  KtorRestClient(
    // our test server runs on port 9999
    nodes = arrayOf(
      Node("localhost", 9999)
    )
  )
  // both SearchClient and KtorRestClient use sensible
  // but overridable defaults for lots of things
)

// we'll generate a random index name
val indexName = "index-${Clock.System.now().toEpochMilliseconds()}"

// most client functions are suspending, so lets use runBlocking
runBlocking {
  // create an index and use our mappings dsl
  client.createIndex(indexName) {
    settings {
      replicas = 0
      shards = 3
    }
    mappings(dynamicEnabled = false) {
      text(TestDocument::name)
      keyword(TestDocument::tags)
    }
  }

  // bulk index some documents
  client.bulk(refresh = Refresh.WaitFor) {
    index(
      source = TestDocument(
        name = "apple",
        tags = listOf("fruit")
      ).json(false),
      index = indexName
    )
    index(
      source = TestDocument(
        name = "orange",
        tags = listOf("fruit", "citrus")
      ).json(false),
      index = indexName,
    )
    index(
      source = TestDocument(
        name = "banana",
        tags = listOf("fruit", "tropical")
      ).json(false),
      index = indexName
    )
  }
  // now let's search using the search DSL
  client.search(indexName) {
    query = bool {
      must(
        term(TestDocument::tags, "fruit"),
        matchPhrasePrefix(TestDocument::name, "app")
      )
    }
  }.let { results ->
    println("Hits: ${results.total}")
    println(results.hits?.hits?.first()?.source)
  }
}

Captured Output:

Hits: 1
{"name":"apple","tags":["fruit"]}

For more details, check the tests. A full manual will follow soon.

Development status

KT Search is currently still under development. So, expect refactoring, renames, package changes, etc. I'll release a 2.0 release (1.x being the legacy client). Until that happens, expect some refactoring. I plan to get to a 2.0 release quickly as I have a clear idea of what needs to be done and how based on my learnings from 1.0 (and the many Java clients I wrote for ES on various projects before that).

Currently there are no releases yet. I plan to address this soon with a release to (probably) maven central.

The search client module is the main module of this library. I extracted the json-dsl module and search-dsls module with the intention of eventually moving these to separate libraries. Json-dsl is useful for pretty much any kind of json dialect. And as my legacy-client module shows, the search-dsls can be used by other clients than the search-dsls module. In fact, I have a vague plan to start writing kotlin multi platform clients for other json APIs that are not related to search.

The legacy client currently only works with Elasticsearch 7. However, beware that there may be some compatibility breaking changes before we release a stable release. Users currently using the old client should stick with the old version for now until we are ready to release an alpha/beta release. After that, you may use it as a migration path.

My intention is to keep the legacy client as an option until I have all relevant functionality ported to the new client. The old repository will continue to exist for now. I am not planning to do any further maintenance on that, however. People are welcome to fork that project of course.

The future is going to be about using the pure kotlin multi-platform client. Of course, you may combine that with other clients; including the old RestHighLevel client or even the legacy client.

Goals/todo's:

For more detail refer to the issue tracker. This is merely my high level plan.

  • Extract the kotlin DSLs to a multi platform module.
  • Rename the project to kt-search and give it its own repository
  • Implement a new client using ktor and kotlinx-serialization
  • Port the IndexRepository to the new client
  • Port the bulk indexing functionality to the new client
  • Update documentation for the new client
  • Delete the legacy client module from this project once all functionality has been ported
  • Extract an interface for the new client and provide alternate implementations. By extracting the dsl, I've created the possibility to use different JSON serialization and parsing strategies. So potentially we could support alternate http transport and parsing without too much trouble.
    • OkHttp / jackson?
    • Es rest client / jackson? - useful if you are interested in using this library and the Elastic client (either their new Java client or their deprecated RestHighLevelClient )
    • Os rest client / jackson? - useful if you are interested in using the Opensearch forks of the Elastic clients.

Once all these boxes are checked, I'm going to release a beta.

Non Goals:

  • Full coverage of what the RestHighLevel client does. If you need it, just add that as a dependency or create your own extension function for SearchClient; it's not that hard.
  • Cover the entire search DSL. The provided Kotlin DSL is easily extensible, so if it doesn't directly support what you need, you can simply manipulate the underlying Map to add what you need. Alternatively, you can create a pull request to add support for the feature that you want. Currently, most commonly used things in the DSL are already supported.

Contributing

I'm tracking a few open issues and would appreciate any help of course. But until this stabilizes, reach out to me before doing a lot of work to create a pull request. Check the here for mote details.

About this README

It's generated using the same kotlin4example library that I also used for the old client documentation. It's great for including little code snippets that are actually executing as part of the tests and therefore know correct. Also, I can refactor and have the documentation change as well without breaking.

Comments
  • [BUG] Multi-word configuration properties for match queries don't work

    [BUG] Multi-word configuration properties for match queries don't work

    Describe the bug

    Setting MatchQueryConfig.maxExpansions doesn't work

    To Reproduce

    Steps to reproduce the behavior: Configure a match query with maxExpansions = 100 (any number works) and execute the query. An error "[match] query does not support [maxExpansions]" is returned because the client passes "maxExpansions": 100 as part of the JSON sent to the OpenSearch server

    Expected behavior

    "max_expansions": 100 should be passed to the OpenSearch server

    Your context

    latest version 1.99.14 on Ubuntu 22.04

    Will you be able to help with a pull request?

    Sure, I can create a PR

    Overall I think the default for the JsonDsl constructor should be namingConvention = PropertyNamingConvention.ConvertToSnakeCase. That's the naming convention for OpenSearch after all. Naming things camelCase should be the exception, not the rule

    bug 
    opened by yassenb 4
  • [BUG] Searching over multiple indices + ids query not working

    [BUG] Searching over multiple indices + ids query not working

    Describe the bug In advance sorry for bringing these two things as one issue but I don't want to spam it here with questions that might not be "bugs" but more of wrong usage of the library.

    I would like to be able query multiple indices - at first I was looking for some specific method but I didn't find it. Then I thought it would be enough to pass it as "index1, index2" string but that throws exception "no such index [ index2]". That looks like it somehow might support multiple indices (as it's printed as array) search and I am using it wrong but even when a dig a bit in a search-api.kt class I wasn't successful to find how it should be done or if it's supported at all?

    I was used to use the ids with es-kotlin-client but after migration it somehow doesn't work. If I do term query with exact value (single one) it retrieves document as it should. But once I try to use ids query where I convert List<String> to typedArray and then I use the * spread operator it's not working and I receive zero documents for the same document id. Again I tried to dig a bit in term-level-queries.kt class and I suspect that it might be because block is set to null by default? and then it's invoked even tho it seems that here:

    init {
            this["values"] = values
            block?.invoke(this)
        }
    

    it's initialised.

    To Reproduce Steps to reproduce the behavior:

    val response = client.search("index, index2") {
                query = ids(*ids.toTypedArray())
            }.parseHits<Document>()
    
    val documents = listOf("test")
    val response = client.search("default") {
                query = ids(*documents.toTypedArray())
            }.parseHits<Document>()
    

    Expected behavior

    Possible usage of search for multiple indices. Ids SearchDSL should provide possibility to search via multiple ids.

    Your context

    Kotlin version: 1.7.10 Search client version: search-client:1.99.9 Version of Elasticsearch: "number" : "7.17.1",

    Will you be able to help with a pull request?

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

    bug 
    opened by lengerad 4
  • [BUG] Missing authentication crendetials for REST request

    [BUG] Missing authentication crendetials for REST request

    Describe the bug I recently switch from es-kotlin-client but I'm unable to connect to the ES cluster for basic search. I suspect this might be an issue with settings of my ES cluster but since it was working with previous client I'm not sure so posting here first. I found following thread with similar problem here. I guess it might be related to switching to different version of Rest client under the hood? Because all settings (host, port, user) is kept the same from previous usage.

    By the observations it seems that it doesn't matter if I put wrong/correct credentials and it still keeps giving the same result - hence it seems it's really not used.

    To Reproduce Steps to reproduce the behavior:

    I'm using following setup for ES client (as I was used to before):

    private val client = SearchClient(
            KtorRestClient(
                host = host,
                port = port,
                https = https,
                user = user,
                password = password
            )
        )
    

    and ten I just want to search by ids

    val response = client.search(index) {
                query = ids(*ids)
            }
    

    and result is:

    07:42:03.656 [eventLoopGroupProxy-4-1 @call-handler#11] ERROR ktor.application - Unhandled: GET - /v1/document/search/
    com.jillesvangurp.ktsearch.RestException: RequestIsWrong 401: {"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/default/_search]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/default/_search]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}
    	at com.jillesvangurp.ktsearch.RestclientKt.asResult(Restclient.kt:91)
    	at com.jillesvangurp.ktsearch.Request_dslKt.post(request-dsl.kt:70)
    	at com.jillesvangurp.ktsearch.Request_dslKt$post$1.invokeSuspend(request-dsl.kt)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
    	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    	at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda-1$lambda-0(NettyApplicationEngine.kt:285)
    	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    	at java.base/java.lang.Thread.run(Thread.java:832)
    

    Expected behavior Credentials passed in KtorRestClient should be used as it somehow seems that they are missing or invalid.

    Your context

    • what versions of software are you using
    • what operating system are you using
    • whatever else you think is relevant

    Kotlin version: 1.7.10 Search client version: search-client:1.99.5 Version of Elasticsearch: "number" : "7.17.1",

    Will you be able to help with a pull request?

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

    bug 
    opened by lengerad 3
  • [BUG] `java.lang.ArrayIndexOutOfBoundsException` at `at com.jillesvangurp.ktsearch.RoundRobinNodeSelector.selectNode(RoundRobinNodeSelector.kt:6)`

    [BUG] `java.lang.ArrayIndexOutOfBoundsException` at `at com.jillesvangurp.ktsearch.RoundRobinNodeSelector.selectNode(RoundRobinNodeSelector.kt:6)`

    Describe the bug

    When querying an AWS hosted OpenSearch 2.3 service with 3 nodes we get the following exception:

    java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 1
    	at com.jillesvangurp.ktsearch.RoundRobinNodeSelector.selectNode(RoundRobinNodeSelector.kt:6)
    	at com.jillesvangurp.ktsearch.KtorRestClient.nextNode(KtorRestClient.kt:45)
    	at com.jillesvangurp.ktsearch.KtorRestClient.doRequest(KtorRestClient.kt:56)
    	at com.jillesvangurp.ktsearch.RestClient$DefaultImpls.doRequest$default(Restclient.kt:18)
    	at com.jillesvangurp.ktsearch.Request_dslKt.post(request-dsl.kt:65)
    	at com.jillesvangurp.ktsearch.Search_apiKt.search-yk69jQ8(search-api.kt:266)
    	at com.jillesvangurp.ktsearch.Search_apiKt.search-yk69jQ8(search-api.kt:166)
    	at com.jillesvangurp.ktsearch.Search_apiKt.search-mdzbyIQ(search-api.kt:70)
    	at com.jillesvangurp.ktsearch.Search_apiKt.search-mdzbyIQ$default(search-api.kt:21)
    	at com.jillesvangurp.ktsearch.repository.IndexRepository.search(IndexRepository.kt:279)
    	at com.transportapi.placesSearch.search.PlaceIndex$query$1.invokeSuspend(PlaceIndex.kt:320)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
    	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    

    To Reproduce

    The error is triggered by a call to the search()

    Expected behavior

    The node selection should not fail.

    Your context

    com.jillesvangurp:search-client:1.99.13 AWS hosted OpenSearch 2.3

    Also, on subsequent calls it seems the index is just kept increasing and the exceptions looks like:

    java.lang.ArrayIndexOutOfBoundsException: Index 6 out of bounds for length 1
    

     

    Will you be able to help with a pull request?

    A guard condition fix looks trivial but without deeper knowledge of the library structure I'm not 100% sure this is the correct approach. If you are happy with it we can open a PR.

    bug 
    opened by vdimchev 2
  • [FEAT] Add support for _count endpoint

    [FEAT] Add support for _count endpoint

    Describe the enhancement

    What would you like changed?

    Add support for count queries: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html

    Why is this needed?

    This allows more complex pagination flows.

    How do you think it should be done?

    It seems that a count method could be implemented reusing most of the search logic and just changing the endpoint + response handling.

    Will you be able to help with a pull request?

    I am not planning to do the work at this point in time (if needed I may do it in the future if you don't have time).

    opened by friscoMad 1
  • [DOCS] Would be nice to have something about searching for non-string values.

    [DOCS] Would be nice to have something about searching for non-string values.

    Describe the issue

    I'm trying to query on an integer field. I have the below working, but it took some digging to work out - could you drop something like this into the docs? (or something better!)

            query =
                bool {
                    filter(
                        listOf(
                            disMax {
                                queries(
                                    listOf(
                                       ESQuery("match_phrase", JsonDsl().apply {
                                            put("tc_build_id", 18941877)
                                        }),
                                        ESQuery("match_phrase", JsonDsl().apply {
                                            put("tc_build_id", 18992070)
                                        })
                                    )
                                )
                            }
                            , matchPhrase("type", "scenario")
                        )
                    )
                }
    

    And I know I could lose the 'listOf' calls, but I'm leaving them in because I need to build the lists programmatically in my final code. :)

    Will you be able to help with a pull request?

    Sure - let me know if the above is acceptable as an example, and where you want it.

    documentation 
    opened by sleekweasel 1
  • investigate test failures with es 6

    investigate test failures with es 6

    Currently the tests don't pass with Elasticsearch v6. As there were not a lot of changes between 6 and 7, it may be possible to get them to pass.

    Run elasticsearch like so:

    docker run -p 9999:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.8.23
    

    Run the tests with

    ./gradlew :search-client:build
    

    Multiple tests fail trying to create the test document index:

    ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [properties]: Root mapping definition has unsupported parameters:  [number : {type=double}] [tag : {type=keyword}] [message : {type=text}]]]; nested: ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=Root mapping definition has unsupported parameters:  [number : {type=double}] [tag : {type=keyword}] [message : {type=text}]]];
    

    Not super critical, but would be nice to figure this out.

    bug 
    opened by jillesvangurp 1
  • [FEAT] Investigate using annotations for implementation specific features

    [FEAT] Investigate using annotations for implementation specific features

    There are going to be APIs and API extensions that only work with newer versions of Elasticsearch or Opensearch or that work differently on both.

    • create some annotation to mark such features
    • provide run-time warnings if the user tries to use an unsupported feature with the wrong search client
    • add version sniffing option to the rest-client
    opened by jillesvangurp 1
  • [FEAT] add user configurable query params and headers

    [FEAT] add user configurable query params and headers

    Allow users to specify additional query parameters and headers on all search APIs.

    • Similar to the default request options in the RestHighLevel client.
    • Allow setting this on both SearchClient and each of the extension functions.
    opened by jillesvangurp 1
  • [FEAT] scrolling / deep paging searches

    [FEAT] scrolling / deep paging searches

    Similar to what the legacy client did

    • explore different new APIs for this (scrolling was deprecated some time ago)
    • make sure it works across opensearch/elasticsearch
    • use flows, like the legacy client
    opened by jillesvangurp 1
  • [FEAT] safely update documents with optimistic locking

    [FEAT] safely update documents with optimistic locking

    Similar to what the repository did in the old client

    • GET current version
    • apply changes
    • index with seq_no, and primary_term set
    • retry a configurable number of times in case of version conflicts
    opened by jillesvangurp 1
Releases(2.0.0-RC-6)
  • 2.0.0-RC-6(Jan 6, 2023)

    Recent changes in ktor client changed the way they handle basic authentication. They now require to indicate whether you want to send the auth headers with a lambda function, which defaults to returning false!

    This release fixes that issue.

    Full Changelog: https://github.com/jillesvangurp/kt-search/compare/2.0.0-RC-5...2.0.0-RC-6

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0-RC-5(Jan 4, 2023)

    • keyAsInstant extension property on DateHistogramBucket

    Full Changelog: https://github.com/jillesvangurp/kt-search/compare/2.0.0-RC-4...2.0.0-RC-5

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0-RC-4(Jan 4, 2023)

  • 2.0.0-RC-3(Jan 4, 2023)

    Improved the way you deal with aggregation responses to be a bit nicer. We're using this at FORMATION and improving things as we go.

    • You can now use enum values for aggregation names so you don't have to use string literals. You can use the enum values to dig out the corresponding response as well, e.g. val dtr = response.aggregations.dateHistogramResult(MyAggNames.BY_DATE)
    • Rename a few extension functions for getting to the parsed buckets for the various aggregations
    • New wrapper class that gives you access to both the sub aggregations and the parsed bucket and an extension property on BucketAggregationResult<T> to get that.

    What's Changed

    • improve aggregations responses by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/49

    Full Changelog: https://github.com/jillesvangurp/kt-search/compare/2.0.0-RC-2...2.0.0-RC-3

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0-RC-2(Jan 3, 2023)

    Jitpack has failed me again. Somehow it keeps flipping between working, half working and not working at all with multi platform. It was fine for a few weeks and now all my projects no longer publish correctly.

    So the documentation has been updated with the maven repository and the build files have been adjusted. RC-1 never downloaded correctly because of this. RC-2 should work. But do mind the changed groupId

    Otherwise no relevant changes.

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0-RC-1(Jan 2, 2023)

    We were missing a few terms and text level queries. Now all of those are supported.

    There are still a few missing query types listed as joining queries and specialized queries in the ES documentation. These may be added as needed.

    Otherwise, the last few weeks, we've expanded the query support over several releases, added aggregation query support as well, and improved the documentation. So, labeling this as a release candidate.

    What's Changed

    • implement terms_set query by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/44
    • implement combined fields by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/45
    • intervals query support with nice dsl by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/48

    Full Changelog: https://github.com/jillesvangurp/kt-search/compare/1.99.20...2.0.0-RC-1

    Source code(tar.gz)
    Source code(zip)
  • 1.99.20(Dec 27, 2022)

    X-mas release. I had some downtime and spent it documenting things, dotting a few i-s and implementing some missing stuff.

    What's Changed

    • document all queries by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/41
    • implement count api by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/42
    • implement and document msearch by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/43

    Full Changelog: https://github.com/jillesvangurp/kt-search/compare/1.99.19...1.99.20

    Source code(tar.gz)
    Source code(zip)
  • 1.99.19(Dec 25, 2022)

    What's Changed

    • function score support, remove codegen plugin, improve query docs by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/34
    • docker updates by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/35
    • search documentation by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/36

    Full Changelog: https://github.com/jillesvangurp/kt-search/compare/1.99.18...1.99.19

    Source code(tar.gz)
    Source code(zip)
  • 1.99.18(Dec 21, 2022)

    This is a relatively big release in preparation for what will hopefully be a short path to a 2.0 release.

    What's Changed

    • remove legacy client by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/29
      • Originally intended as a migration path. I think it has served its purpose and the hassle of maintaining it and keeping it working is not worth it any more
    • make snake case the default for JsonDsl again by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/30
      • Thanks @yassenb for pointing out the obvious
    • dependencies by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/31
      • Latest everything. Except gradle. There seems to be an issue with 7.6 and kotlin multi platform when running the tests. Kotlin 1.8 should resolve this in a few weeks.
    • aggregation support by @jillesvangurp in https://github.com/jillesvangurp/kt-search/pull/32
      • This lays the ground work for working with aggregations in a sane way and was one of the last big missing pieces.
      • also see the newly added manual page for this

    Full Changelog: https://github.com/jillesvangurp/kt-search/compare/1.99.17...1.99.18

    Source code(tar.gz)
    Source code(zip)
  • 1.99.17(Dec 15, 2022)

    Several bug fixes for things reported by @yassenb and @iddelchev. Thanks both!

    • #28 The JsonDsl no longer defaults to snake casing which was wrong in a lot of places. This is now fixed.
    • #27 total hits is now nullable as it might not be there always
    • #25 Round robin is now thread safe.

    Especially because of #28, everybody should update to this release.

    Source code(tar.gz)
    Source code(zip)
  • 1.99.16(Nov 30, 2022)

  • 1.99.15(Nov 29, 2022)

  • 1.99.14(Nov 23, 2022)

  • 1.99.13(Aug 25, 2022)

  • 1.99.12(Aug 21, 2022)

    • misc fixes related to adding support for dynamic templates
    • objField mapping now supports dynamic, the block is now optional
    • getIndex & getIndexMappings API
    • case sensitivity support for wildcard query
    Source code(tar.gz)
    Source code(zip)
  • 1.99.9(Aug 19, 2022)

    • Fix #19, basic authentication was not working. We now depend on ktor auth and properly configure basic authentication.

    Thanks @lengerad for reporting

    Source code(tar.gz)
    Source code(zip)
  • 1.99.8(Aug 18, 2022)

    This release adds a lot of features related to index management as well as a few smaller improvements.

    • APIs & DSL for managing index templates and component templates
    • API & DSL for managing ILM policies
    • Improve Settings DSL for analyzers (note slight incompatibility if you were using the old way)
    • Support index alias management and a DSL for that
    • create index block is now optional
    • JsonDsl properties now have an optional default value
    Source code(tar.gz)
    Source code(zip)
  • 1.99.7(Aug 9, 2022)

    • callback now supports request failures as well
    • more flexible handling of exceptions in the BulkSession. Defaults to throwing and closing the session.
    Source code(tar.gz)
    Source code(zip)
  • 1.99.5(Jul 30, 2022)

    • default keepAlive of 1 minute on searchAfter
    • simplify IndexRepository search response now that we have parseHits
    • add parseHit extension function to SearchResponse.Hit
    • add delete point in time API
    Source code(tar.gz)
    Source code(zip)
  • 1.99.4(Jul 30, 2022)

    • add opensearch 2 as a supported version, mark search_after as supported by opensearch 2.x
    • new usable extension property on ClusterStatus that is true if yellow or green.
    • add an example kts script and document how to use kt-search with kts scripts
    • add parseHit on SearchResponse
    • add ids extension function to quickly get the ids out of the search response
    • make the SearchDSL block optional so you can search for everything
    • add a variant of indexDocument that serializes an object
    • much improved documentation
    Source code(tar.gz)
    Source code(zip)
  • 1.99.3(Jul 28, 2022)

    • documentation is no longer a work in progress, added lots of it
    • add extension functions to BulkSession that serialize an object
    • support kproperty for key names in JsonDsl
    Source code(tar.gz)
    Source code(zip)
  • 1.99.2(Jul 27, 2022)

    A few minor tweaks:

    • sort dsl add functions now have default values for most parameters
    • support missing on sort fields
    • the block parameter for IndexRepository.createMapping now comes last so you can move it outside of the parentheses
    Source code(tar.gz)
    Source code(zip)
  • 1.99.1(Jul 22, 2022)

    • Search client dependencies are now pulled in transitively.
    • Add coerceInputValues to default json configuration for kotlinx.serialization to ensure new enum values don't break deserialization
    Source code(tar.gz)
    Source code(zip)
  • 1.99.0(Jul 10, 2022)

    Lots of changes since 1.x

    • Multi platform, kotlinx serialization and kto based
    • Compatible with Opensearch, Elasticsearch 7 & 8
    • No more Java Rest High Level client dependence or code generation for that.
    • Improved DSL support
    Source code(tar.gz)
    Source code(zip)
Owner
Jilles van Gurp
CTO of FORMATION & Freelance Elasticsearch consultant.
Jilles van Gurp
Android Search View based on Material design guidelines.

Android SearchView based on Material Design guidelines. The MaterialSearchView will overlay a Toolbar or ActionBar as well as display a ListView for the user to show suggested or recent searches.

Maurício C. P. Pessoa 1.1k Nov 11, 2022
Intellij Idea plugin to push indexing metrics into an Elasticsearch cluster

indexing-metrics-collector Allows gathering IntelliJ IDEA project scanning & indexing metrics for further analysis by ingesting them into an elasticse

Rene Groeschke 6 Nov 26, 2022
This library provides Easy Android ListView Adapters(EasyListAdapter & EasyCursorAdapter) which makes designing Multi-Row-Type ListView very simple & cleaner, It also provides many useful features for ListView.

EasyListViewAdapters Whenever you want to display custom items in listview, then only way to achieve this is to implement your own subclass of BaseAda

Biraj Patel 132 Nov 25, 2022
A multi-platform Collins Dictionary client, supports for Desktop(Windows/Linux/MacOS) and Android.

Collins Dictionary This is a multi-platform Collins Dictionary client, supports for Desktop(Windows/Linux/MacOS) and Android. For Linux and MacOS, ple

KonYaco 57 Dec 30, 2022
A stock market app , with cached , search functionality , and market overview in the form of graph statics

A stock market app , with cached , search functionality , and market overview in the form of graph statics. The graph really looks cool (jetpack compose, SOLID priciples).

SUMIT KUMAR 1 May 20, 2022
Fontize is an Android library that enables multi-font selection functionality to diversify your app.

Fontize Android Library Built with ❤︎ by Gourav Khunger Fontize is an Android library, written in kotlin, that enables your android app have multiple

Gourav Khunger 8 Nov 28, 2022
PokeDexApi is a simple version of PokeApi with search functionality.

PokeDex Api PokeDexApi is a simple version of PokeApi with search functionality based on KTOR. Documentation Base Url https://poki-dex.herokuapp.com E

Rohit Sharma 1 Jan 15, 2022
Kotter - aims to be a relatively thin, declarative, Kotlin-idiomatic API that provides useful functionality for writing delightful console applications.

Kotter (a KOTlin TERminal library) aims to be a relatively thin, declarative, Kotlin-idiomatic API that provides useful functionality for writing delightful console applications.

Varabyte 348 Dec 21, 2022
Android app to search for covid vaccine slots, turn on background search & get notifications when slots are available

CowinNotifier Android app to search for covid vaccine slots, turn on background search & get notifications when slots are available Glipmse of the App

Ujjwal Kumar Maharana 3 Dec 29, 2022
A simple Cat Search app, performed the search by cat breed name, using MVVM clean Architecture.

CatSearchApp A simple Cat Search app, performed the search by cat breed name, using MVVM clean Architecture. The App is using the The Cat Api for sear

Mansingh Bhati 2 Oct 20, 2022
Anime-Info-Search-Jikan - Search Information about Anime

Anime-Info-Search-Jikan Search Information about Anime. Home Page Information Pa

null 3 Nov 13, 2022
Image-search - An Image search android app with offline support

image-search Image search app built using bing image search API via paging 3. Fe

Suraj Vaishnav 3 Feb 17, 2022
Kotlin multi-platform logging library with structured logging and coroutines support

Klogging Klogging is a pure-Kotlin logging library that aims to be flexible and easy to use. It uses Kotlin idioms for creating loggers and sending lo

Klogging 51 Dec 20, 2022
Built the ccp code on compose. Country Code Picker is an android library which provides an easy way to search and select country or international phone code.

Built the ccp code on compose. Country Code Picker is an android library which provides an easy way to search and select country or international phone code.

utku glsvn 7 Oct 23, 2022
Appleader707 1 Aug 9, 2022
Kotlin multi-platform application navigation library.

navigation Kotlin multi-platform application navigation library. Supports Jetpack Compose. val navigator = rememberNavigatorByKey("Greeting") { key ->

Christopher 9 Jan 2, 2023
Kotlin multi-platform simple File I/O library

KmpIO This is a Kotlin multiplatform (KMP) library for basic Text file, Binary file, and zip/archive file IO. It was initially implemented with the an

Steven K Olson 9 Oct 1, 2022
Kotlin multi platform project template and sample app with everything shared except the UI. Built with clean architecture + MVI

KMMNewsAPP There are two branches Main News App Main The main branch is a complete template that you can clone and use to build the awesome app that y

Kashif Mehmood 188 Dec 30, 2022