mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Specificly search for field id vs name
This commit is contained in:
@ -103,6 +103,8 @@ object ItemQuery {
|
||||
|
||||
final case class CustomFieldMatch(name: String, op: Operator, value: String)
|
||||
extends Expr
|
||||
final case class CustomFieldIdMatch(id: String, op: Operator, value: String)
|
||||
extends Expr
|
||||
|
||||
final case class Fulltext(query: String) extends Expr
|
||||
|
||||
|
@ -56,5 +56,7 @@ object ExprUtil {
|
||||
expr
|
||||
case CustomFieldMatch(_, _, _) =>
|
||||
expr
|
||||
case CustomFieldIdMatch(_, _, _) =>
|
||||
expr
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package docspell.query.internal
|
||||
|
||||
import cats.parse.{Parser => P}
|
||||
|
||||
import docspell.query.ItemQuery.Expr.CustomFieldMatch
|
||||
import docspell.query.ItemQuery._
|
||||
|
||||
object SimpleExprParser {
|
||||
@ -62,7 +61,13 @@ object SimpleExprParser {
|
||||
val customFieldExpr: P[Expr.CustomFieldMatch] =
|
||||
(P.string("f:") *> BasicParser.identParser ~ op ~ BasicParser.singleString).map {
|
||||
case ((name, op), value) =>
|
||||
CustomFieldMatch(name, op, value)
|
||||
Expr.CustomFieldMatch(name, op, value)
|
||||
}
|
||||
|
||||
val customFieldIdExpr: P[Expr.CustomFieldIdMatch] =
|
||||
(P.string("f.id:") *> BasicParser.identParser ~ op ~ BasicParser.singleString).map {
|
||||
case ((name, op), value) =>
|
||||
Expr.CustomFieldIdMatch(name, op, value)
|
||||
}
|
||||
|
||||
val inboxExpr: P[Expr.InboxExpr] =
|
||||
@ -81,6 +86,7 @@ object SimpleExprParser {
|
||||
tagIdExpr,
|
||||
tagExpr,
|
||||
catExpr,
|
||||
customFieldIdExpr,
|
||||
customFieldExpr,
|
||||
inboxExpr,
|
||||
dirExpr
|
||||
|
Reference in New Issue
Block a user