quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.58k stars 2.63k forks source link

query error in ftsearch() when not wrapping with "" #38337

Closed stephane-drogou closed 8 months ago

stephane-drogou commented 8 months ago

Describe the bug

According the resolution of the issue #38330, I removed the wrapping "" on the query in th call of ftsearch() function.

I have a now a new error and the call still doesn't work

Expected behavior

After this call :

String query = "@voie:{"+idVoie+"} @pk:["+pkDebut+" "+pkFin+"]";
StringBuilder retour = new StringBuilder("");
SearchQueryResponse result = searchc.ftSearch(index, query);

I expect to receive the key corresponding to the query.

Actual behavior

This call provide the following error :

2024-01-22 18:39:35,648 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /referentiel/check failed, error id: 4e11f30b-e282-4d12-8b29-fff3090e8a1b-2: java.lang.RuntimeException: Multi is a Map at io.vertx.redis.client.impl.types.MultiType.get(MultiType.java:114) at io.vertx.mutiny.redis.client.Response.get(Response.java:189) at io.quarkus.redis.runtime.datasource.ReactiveSearchCommandsImpl.decodeSearchQueryResult(ReactiveSearchCommandsImpl.java:188) at io.quarkus.redis.runtime.datasource.ReactiveSearchCommandsImpl.lambda$ftSearch$7(ReactiveSearchCommandsImpl.java:181) at io.smallrye.context.impl.wrappers.SlowContextualFunction.apply(SlowContextualFunction.java:21) at io.smallrye.mutiny.operators.uni.UniOnItemTransform$UniOnItemTransformProcessor.onItem(UniOnItemTransform.java:36) at io.smallrye.mutiny.vertx.AsyncResultUni.lambda$subscribe$1(AsyncResultUni.java:35) at io.smallrye.mutiny.vertx.DelegatingHandler.handle(DelegatingHandler.java:25) at io.quarkus.redis.runtime.client.ObservableRedis.lambda$send$1(ObservableRedis.java:54) at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141) at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) at io.vertx.core.impl.future.FutureImpl.addListener(FutureImpl.java:196) at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43) at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23) at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49) at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) at io.vertx.core.impl.future.SucceededFuture.addListener(SucceededFuture.java:88) at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43) at io.vertx.core.impl.future.FutureImpl$ListenerArray.onSuccess(FutureImpl.java:262) at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54) at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:86) at io.vertx.core.impl.DuplicatedContext.execute(DuplicatedContext.java:184) at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:51) at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23) at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49) at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:41) at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:23) at io.vertx.core.net.impl.pool.Endpoint.lambda$getConnection$0(Endpoint.java:52) at io.vertx.redis.client.impl.RedisConnectionManager$RedisEndpoint.lambda$requestConnection$0(RedisConnectionManager.java:438) at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:55) at io.vertx.core.impl.EventLoopContext.lambda$emit$1(EventLoopContext.java:62) at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:833)

How to Reproduce?

You can find the reproducer here : https://github.com/stephane-drogou/redis-search-example

On this repository : https://github.com/stephane-drogou/redis-search-example.git

I update it by removing the wrapping ""

To reproduce it you have to do the following commandsd in redis-cli :

ft.create idx:voiture on hash prefix 1 voiture:dyn: schema pk numeric sortable voie tag sortable
hmset voiture:dyn:001 pk 10 voie c8l2
hmset voiture:dyn:002 pk 22 voie c8l2
hmset voiture:dyn:003 pk 10 voie c9l2
hmset voiture:dyn:004 pk 14 voie c8l2

Then the code corresponds to the following command : ft.search idx:voiture "@voie:{c8l2} @pk:[8 16]"

It provides a REST endpoint to be tested : /referentiel/check

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

stephane-drogou commented 8 months ago

I used a 7.2.4 Redis server version. This client manage only 6.2.X version. I needed to upgrade quarkus version to use this Redis version.

The problem can be closed.