Multiple term tags search fails


I am having a trouble. Maybe someone can help.

I am using Tropy Version 1.12.0 (x64) in a Mac Mojave 10.14.6 and running a Tropy project in a cloud. While transferring the project to the cloud I consolidated the images and got few times database errors (as far as I can remember in logs were a statement like “database corrupted”).

Then I created the project again, this time without consolidating but rather doing everything over again. However obviously I messed up something in the database (or somewhere else) while consolidating the images, such that my search queries will not interpreted as expected. From the log file I understand that my second term will not be considered or considered falsely. When I use a search query like: (1) ‘A AND B’ or (2) ‘“A” AND “B”’ I get the following errors in the log file:

{“level”:40,“time”:1672303063296,“type”:“renderer”,“name”:“project”,“list”:false,“query”:“A AND”,“tags”:false,“stack”:“Error: SQLITE_ERROR: fts5: syntax error near "*"”,“trash”:null,“msg”:“search failed"}
{“level”:40,“time”:1672303063614,“type”:“renderer”,“name”:“project”,“list”:false,“query”:"A AND ",“tags”:false,“stack”:"Error: SQLITE_ERROR: fts5: syntax error near "
"”,“trash”:null,“msg”:“*search failed”}

{“level”:40,“time”:1672303163334,“type”:“renderer”,“name”:“project”,“list”:false,“query”:“"A" AND”,“tags”:false,“stack”:“Error: SQLITE_ERROR: fts5: syntax error near ""”,“trash”:null,“msg”:“*search failed”}
{“level”:40,“time”:1672303163617,“type”:“renderer”,“name”:“project”,“list”:false,“query”:“"A" AND “,“tags”:false,“stack”:“Error: SQLITE_ERROR: fts5: syntax error near ""”,“trash”:null,“msg”:”*search failed”}
{“level”:40,“time”:1672303166210,“type”:“renderer”,“name”:“project”,“list”:false,“query”:“"A" AND B"”,“tags”:false,“stack”:“Error: SQLITE_ERROR: unterminated string”,“trash”:null,“msg”:“*search failed”}

Is it a problem in the database? Or somewhere else? How could I solve it? And one last question: Multiple term search on metadata is as far as I know still not implemented, but it is possible to search multiple term on tags. So I am duplicating the information from metadata to tags. Would it cause any problems, or is it a poor idea?

The quick search field has limited capabilities for advanced search at the moment, but for advanced usage you should be able to use SQLite FTS queries directly. So, for example, the query A OR B should work fine; we hope to add a separate advanced search module in the future to make this easier.

If the database file is corrupted that’s definitely cause for concern. When you open the project file Tropy makes a routine integrity check and should show a warning next to the project file if it detects any issues with the file. If you enable developer mode there are also some db optimization/re-index actions available in the developer menu. But in general, if the project file’s integrity check fails it would be best if you could share the file with us so that we can take a look and try to fix the issue.