From 88234986e687e2f8c2a92a86ee106c54e2fd6609 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 13 Jun 2020 21:17:29 +0200 Subject: [PATCH] Make name field search in item name only Now there is an `allNames` field that searches names of multiple things. --- modules/restapi/src/main/resources/docspell-openapi.yml | 5 +++++ .../store/src/main/scala/docspell/store/queries/QItem.scala | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/restapi/src/main/resources/docspell-openapi.yml b/modules/restapi/src/main/resources/docspell-openapi.yml index 20152dfc..b2698722 100644 --- a/modules/restapi/src/main/resources/docspell-openapi.yml +++ b/modules/restapi/src/main/resources/docspell-openapi.yml @@ -3354,8 +3354,13 @@ components: - outgoing name: type: string + description: | + Search in item names. allNames: type: string + description: | + Search in item names, correspondents, concerned entities + and notes. corrOrg: type: string format: ident diff --git a/modules/store/src/main/scala/docspell/store/queries/QItem.scala b/modules/store/src/main/scala/docspell/store/queries/QItem.scala index de47f31b..bad0aa59 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QItem.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QItem.scala @@ -291,7 +291,7 @@ object QItem { IC.state.prefix("i").isOneOf(q.states), IC.incoming.prefix("i").isOrDiscard(q.direction), name - .map(n => or(IC.name.prefix("i").lowerLike(n), IC.notes.prefix("i").lowerLike(n))) + .map(n => IC.name.prefix("i").lowerLike(n)) .getOrElse(Fragment.empty), allNames .map(n =>