From ae265ed19a43c9a18d0b9ce1fa40e0dc246dbee2 Mon Sep 17 00:00:00 2001 From: eikek Date: Sat, 4 Jun 2022 10:16:03 +0200 Subject: [PATCH] Fix tests for mariadb --- .../scala/docspell/addons/AddonExecutorTest.scala | 2 +- .../scala/docspell/ftspsql/MigrationTest.scala | 2 +- .../scala/docspell/ftspsql/PsqlFtsClientTest.scala | 2 +- .../scala/docspell/store/fts/TempFtsOpsTest.scala | 11 +++++------ website/site/content/docs/webapp/finding.md | 14 ++++++++++---- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/modules/addonlib/src/test/scala/docspell/addons/AddonExecutorTest.scala b/modules/addonlib/src/test/scala/docspell/addons/AddonExecutorTest.scala index 946befab80..d18556a361 100644 --- a/modules/addonlib/src/test/scala/docspell/addons/AddonExecutorTest.scala +++ b/modules/addonlib/src/test/scala/docspell/addons/AddonExecutorTest.scala @@ -20,7 +20,7 @@ class AddonExecutorTest extends CatsEffectSuite with Fixtures with TestLoggingCo val logger = docspell.logging.getLogger[IO] override def docspellLogConfig = - super.docspellLogConfig.copy(minimumLevel = Level.Trace) + super.docspellLogConfig.copy(minimumLevel = Level.Error) tempDir.test("select docker if Dockerfile exists") { dir => for { diff --git a/modules/fts-psql/src/test/scala/docspell/ftspsql/MigrationTest.scala b/modules/fts-psql/src/test/scala/docspell/ftspsql/MigrationTest.scala index fd297681d8..b96832b55c 100644 --- a/modules/fts-psql/src/test/scala/docspell/ftspsql/MigrationTest.scala +++ b/modules/fts-psql/src/test/scala/docspell/ftspsql/MigrationTest.scala @@ -27,7 +27,7 @@ class MigrationTest PostgreSQLContainer.Def(DockerImageName.parse("postgres:14")) override def docspellLogConfig: LogConfig = - super.docspellLogConfig.docspellLevel(Level.Debug) + super.docspellLogConfig.docspellLevel(Level.Error) test("create schema") { withContainers { cnt => diff --git a/modules/fts-psql/src/test/scala/docspell/ftspsql/PsqlFtsClientTest.scala b/modules/fts-psql/src/test/scala/docspell/ftspsql/PsqlFtsClientTest.scala index 55873e1011..e98edb3328 100644 --- a/modules/fts-psql/src/test/scala/docspell/ftspsql/PsqlFtsClientTest.scala +++ b/modules/fts-psql/src/test/scala/docspell/ftspsql/PsqlFtsClientTest.scala @@ -32,7 +32,7 @@ class PsqlFtsClientTest private val table = FtsRepository.table override def docspellLogConfig: LogConfig = - super.docspellLogConfig.docspellLevel(Level.Debug) + super.docspellLogConfig.docspellLevel(Level.Error) test("insert data into index") { withContainers { cnt => diff --git a/modules/store/src/test/scala/docspell/store/fts/TempFtsOpsTest.scala b/modules/store/src/test/scala/docspell/store/fts/TempFtsOpsTest.scala index 093cf90de7..4946f39fec 100644 --- a/modules/store/src/test/scala/docspell/store/fts/TempFtsOpsTest.scala +++ b/modules/store/src/test/scala/docspell/store/fts/TempFtsOpsTest.scala @@ -16,9 +16,7 @@ import fs2.Stream import docspell.common._ import docspell.ftsclient.FtsResult import docspell.ftsclient.FtsResult.{AttachmentData, ItemMatch} -import docspell.logging.Level import docspell.store._ -import docspell.store.fts.RFtsResult import docspell.store.qb.DSL._ import docspell.store.qb._ import docspell.store.queries.{QItem, Query} @@ -28,7 +26,6 @@ import doobie._ class TempFtsOpsTest extends DatabaseTest { private[this] val logger = docspell.logging.getLogger[IO] - override def rootMinimumLevel = Level.Info override def munitFixtures = postgresAll ++ mariaDbAll ++ h2All @@ -174,7 +171,7 @@ class TempFtsOpsTest extends DatabaseTest { } def makeCollective(cid: Ident): RCollective = - RCollective(cid, CollectiveState.Active, Language.English, true, Timestamp.Epoch) + RCollective(cid, CollectiveState.Active, Language.English, true, ts) def makeItem(n: Int, cid: Ident): RItem = RItem( @@ -191,9 +188,11 @@ class TempFtsOpsTest extends DatabaseTest { None, None, None, - Timestamp.Epoch, - Timestamp.Epoch, + ts, + ts, None, None ) + + val ts = Timestamp.ofMillis(1654329963743L) } diff --git a/website/site/content/docs/webapp/finding.md b/website/site/content/docs/webapp/finding.md index 205cde2a77..21d9f88d8a 100644 --- a/website/site/content/docs/webapp/finding.md +++ b/website/site/content/docs/webapp/finding.md @@ -161,11 +161,17 @@ unless one of the following is true: ## The Query The query string for full text search is very powerful. Docspell -currently supports [Apache SOLR](https://solr.apache.org/) as -full text search backend, so you may want to have a look at their -[documentation on query +currently supports [Apache SOLR](https://solr.apache.org/) and +[PostgreSQL](https://www.postgresql.org/docs/14/textsearch.html) as +full text search backends. You may want to have a look at [SOLRs +documentation on query syntax](https://solr.apache.org/guide/8_4/query-syntax-and-parsing.html#query-syntax-and-parsing) -for a in depth guide. +for a in depth guide for how to search with SOLR. PostgreSQL also has +[documentation](https://www.postgresql.org/docs/14/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES) +about parsing queries, Docspell by default uses +`websearch_to_tsquery`. + +Here is a quick overview for SOLR queries: - Wildcards: `?` matches any single character, `*` matches zero or more characters