Closed lengerad closed 2 years ago
It should be possible to get this working one way or another.
Can now use the logging
parameter to debug what request the client actually sends. There probably is a bug somwhere. Maybe the comma is being escaped or something.
Otherwise, you can experiment with using the restClient directly. Something like this should be the solution. Just look at the search function; it should be doing something similar.
client.restClient.post {
path("index1,index2","_search")
body=SearchDsl().apply {
}.json()
}
Actually found the issue; serialization issue. I'll push a fix shortly.
Thanks for fixing up the ids, I found out that my question 1. related to the multiple indices it was silly fault that it shouldn't contain ` space between
,and next index. So that was my fault 🙈. Thanks for helping me out, if anyone would read this use with the same issue just check that the structure is:
index,index2`
New release pulled and tested and it's 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 asearch-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
withes-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 useids
query where I convertList<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 interm-level-queries.kt
class and I suspect that it might be becauseblock
is set to null by default? and then it's invoked even tho it seems that here:it's initialised.
To Reproduce Steps to reproduce the behavior:
2.
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.