Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodic Queries: doesn't like full text search #2988

Open
TheFehr opened this issue Mar 3, 2025 · 4 comments
Open

Periodic Queries: doesn't like full text search #2988

TheFehr opened this issue Mar 3, 2025 · 4 comments

Comments

@TheFehr
Copy link

TheFehr commented Mar 3, 2025

I added a full text search as the query for a periodic query but now the list will no longer load due to a 500 internal error.

2025.03.03 13:10:20:0002 [io-comp...] [ERROR] docspell.restserver.RestServer.httpApp:133 - Processing the request resulted in an error.
java.lang.RuntimeException: Failed to read input near 13:
(& content:""Date";"Amount";"Original amount";"Original currency";"Exchange rate";"Description";"Subject";"Category";"Tags";"Wise";"Spaces"" )
Details: Expected: )                                                                              at scala.sys.package$.error(package.scala:27)        at docspell.query.ItemQueryParser$.$anonfun$parseUnsafe$1(ItemQueryParser.scala:42)
        at scala.util.Either.fold(Either.scala:198)                                               at docspell.query.ItemQueryParser$.parseUnsafe(ItemQueryParser.scala:42)                  at docspell.restserver.routes.PeriodicQueryRoutes$.$anonfun$taskToSettings$3(PeriodicQueryRoutes.scala:169)                                                                         at scala.Option.map(Option.scala:242)                                                     at docspell.restserver.routes.PeriodicQueryRoutes$.taskToSettings(PeriodicQueryRoutes.scala:169)                                                                                    at docspell.restserver.routes.PeriodicQueryRoutes$$anonfun$apply$1.$anonfun$applyOrElse$1(PeriodicQueryRoutes.scala:44)                                                             at fs2.Stream.evalOut$1(Stream.scala:1038)
        at fs2.Stream.$anonfun$evalMap$2(Stream.scala:1039)                                       at fs2.Pull$FlatMapR$1.loop$1(Pull.scala:1053)
        at fs2.Pull$FlatMapR$1.go$2(Pull.scala:1060)                                              at fs2.Pull$FlatMapR$1.unconsed(Pull.scala:1070)
        at fs2.Pull$FlatMapR$1.out(Pull.scala:1079)                                               at fs2.Pull$.$anonfun$compile$24(Pull.scala:1237)
        at fs2.Pull$.$anonfun$compile$2(Pull.scala:953)                                           at get @ fs2.internal.Scope.openScope(Scope.scala:275)
        at get @ fs2.internal.Scope.openScope(Scope.scala:275)                                    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
        at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)                              at flatMap @ fs2.Pull$.fs2$Pull$$interruptGuard$1(Pull.scala:952)
        at map @ fs2.internal.InterruptContext.$anonfun$eval$5(InterruptContext.scala:96)         at main$ @ docspell.restserver.Main$.main(Main.scala:14)
        at as @ docspell.restserver.RestServer$.$anonfun$serve$4(RestServer.scala:75)     
2025.03.03 13:10:20:0003 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 GET /api/v1/sec/usertask/periodicquery
@eikek
Copy link
Owner

eikek commented Mar 4, 2025

Hi @TheFehr, it looks like the query is wrong. Of course, this shouldn't get stored in the first place 🙈 I suspect it is because of the double quotes and ;. Having quotes in quotes you need to use a \ inside a single quote. Can you try to fix it in the DB as a short term fix?

@TheFehr
Copy link
Author

TheFehr commented Mar 4, 2025

Yeah I set the query to a valid empty one via the db and then just used a bookmark instead.

The query works with a bookmark 😅
(& content:"\"Date\";\"Amount\";\"Original amount\";\"Original currency\";\"Exchange rate\";\"Description\";\"Subject\";\"Category\";\"Tags\";\"Wise\";\"Spaces\"" )

@eikek
Copy link
Owner

eikek commented Mar 5, 2025

Ah ok, so you mean that the exact same query doesn't work when configured with a periodic query but does work for a bookmark?

@TheFehr
Copy link
Author

TheFehr commented Mar 6, 2025

Yes, I worked the query out in search, then added it to a periodic which caused the crash.
Adding it to a bookmark works just like using it directly in search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants