diff --git a/modules/restapi/src/main/resources/docspell-openapi.yml b/modules/restapi/src/main/resources/docspell-openapi.yml index 401534b1..55d0cdc4 100644 --- a/modules/restapi/src/main/resources/docspell-openapi.yml +++ b/modules/restapi/src/main/resources/docspell-openapi.yml @@ -3028,40 +3028,6 @@ paths: schema: $ref: "#/components/schemas/ItemLightList" - /sec/item/searchIndex: - post: - operationId: "sec-item-search-index" - tags: [ Item Search ] - summary: Search for items using full-text search only. - description: | - Search for items by only using the full-text search index. - - Unlike the other search routes, this one only asks the - full-text search index and returns only one group that - contains the results in the same order as given from the - index. Most full-text search engines use an ordering that - reflect the relevance wrt the search term. - - The other search routes always order the results by some - property (the item date) and thus the relevance ordering is - destroyed when using the full-text search. - security: - - authTokenHeader: [] - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ItemQuery" - responses: - 422: - description: BadRequest - 200: - description: Ok - content: - application/json: - schema: - $ref: "#/components/schemas/ItemLightList" - /sec/item/searchStats: post: operationId: "sec-item-search-stats-get" diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/ItemRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/ItemRoutes.scala index acf1e63a..a312f187 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/ItemRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/ItemRoutes.scala @@ -13,7 +13,6 @@ import cats.implicits._ import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.backend.ops.OCustomFields.{RemoveValue, SetValue} -import docspell.backend.ops.OFulltext import docspell.backend.ops.OItemSearch.{Batch, Query} import docspell.backend.ops.OSimpleSearch import docspell.backend.ops.OSimpleSearch.StringSearchResult @@ -107,30 +106,6 @@ object ItemRoutes { resp <- searchItemStats(backend, dsl)(settings, fixQuery, itemQuery) } yield resp - case req @ POST -> Root / "searchIndex" => - for { - mask <- req.as[ItemQuery] - limitCapped = mask.limit.exists(_ > cfg.maxItemPageSize) - resp <- mask.query match { - case q if q.length > 1 => - val ftsIn = OFulltext.FtsInput(q) - val batch = Batch( - mask.offset.getOrElse(0), - mask.limit.getOrElse(cfg.maxItemPageSize) - ).restrictLimitTo(cfg.maxItemPageSize) - for { - items <- backend.fulltext - .findIndexOnly(cfg.maxNoteLength)(ftsIn, user.account, batch) - ok <- Ok( - Conversions.mkItemListWithTagsFtsPlain(items, batch, limitCapped) - ) - } yield ok - - case _ => - BadRequest(BasicResult(false, "Query string too short")) - } - } yield resp - case GET -> Root / Ident(id) => for { item <- backend.itemSearch.findItem(id, user.account.collective)