manticoresoftware / manticoresearch

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon
https://manticoresearch.com
GNU General Public License v3.0
8.83k stars 489 forks source link

KT-Elastic integration : Search result json schema issue #2438

Open seredkin opened 1 month ago

seredkin commented 1 month ago

Bug Description:

Dear Manticore Search team,

I'm integrating your datastore with KT-Elastic search client, the indexing works but the search does not. I created a regression example over here: https://github.com/seredkin/manticore-kt-search-integration

There's a schema mismatch and the client works with ES and OS but not with Manticore:

Unexpected JSON token at offset 113: Expected start of the object '{', but had '2' instead at path: $.hits.total
JSON input: ....."failed": 0 },"hits":{"total":2,"total_relation":"eq","max_s.....
kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 113: Expected start of the object '{', but had '2' instead at path: $.hits.total
JSON input: ....."failed": 0 },"hits":{"total":2,"total_relation":"eq","max_s.....

Manticore Search Version:

v1.0.18

Operating System Version:

Ubuntu Linux

Have you tried the latest development version?

No

Internal Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

- [ ] Implementation completed - [ ] Tests developed - [ ] Documentation updated - [ ] Documentation reviewed - [ ] Changelog updated
tomatolog commented 1 month ago

I use coker container to run your example like

docker run --rm -it bash  gradle:jdk22

then issue ./gradlew test --info after repo checkout but it end up with the error

KtSearchManticoreExample > initializationError FAILED
    java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
        at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:277)
        at java.base/java.util.Optional.orElseThrow(Optional.java:403)
        at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:268)
        at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:152)
        at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:194)
        at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:106)
        at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
        at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:329)
        at KtSearchManticoreExample$Companion$setup$1.invokeSuspend(KtSearchManticoreExample.kt:27)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at KtSearchManticoreExample$Companion.setup(KtSearchManticoreExample.kt:23)
        at KtSearchManticoreExample.setup(KtSearchManticoreExample.kt)

1 test completed, 1 failed
Finished generating test XML results (0.014 secs) into: /home/gradle/manticore-kt-search-integration/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.015 secs) into: /home/gradle/manticore-kt-search-integration/build/reports/tests/test

[31mFAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
[33m> There were failing tests. See the report at: file:///home/gradle/manticore-kt-search-integration/build/reports/tests/test/index.html

* Try:
[33m> Run with --scan to get full insights.

[31;1mBUILD FAILED in 53s
2 actionable tasks: 2 executed
Some of the file system contents retained in the virtual file system are on file systems that Gradle doesn't support watching. The relevant state was discarded to ensure changes to these locations are properly detected. You can override this by explicitly enabling file system watching.

here is the full log file 2438.log

It could be better to provide fully conterized example or Docker file that could run locally and shows the issue as we do not have expertise in gradlew or Java setup.

sanikolaev commented 1 month ago

What is "KT-Elastic"? I can find only this issue if I look for it in Google.

image

Please provide a link to it, so we understand more about what you are trying to integrate Manticore with.