mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Remove obsolete endpoint
Search by index is the same as a search with only a `content:` expression.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user