The branch, master has been updated
via c00de32585b mdssvc: add support for parsing date ranges
via 1239e5a4c7f mdssvc: add a test for parsing Spotlight date ranges
via 3b2b5098390 mdssvc: reduce a log level to DEBUG
from 93d21dc7e96 third_party: Update cmocka to version 1.1.8
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit c00de32585bf47ec4753f966fe9ac4dd2fb8f4e7
Author: Ralph Boehme <[email protected]>
Date: Wed Oct 15 15:01:16 2025 +0200
mdssvc: add support for parsing date ranges
Example:
InRange(kMDItemContentCreationDate,$time.iso(2024-12-31T23:00:00Z),$time.iso(2025-12-31T23:00:00Z))
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15930
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
Autobuild-User(master): Ralph Böhme <[email protected]>
Autobuild-Date(master): Mon Oct 20 10:59:03 UTC 2025 on atb-devel-224
commit 1239e5a4c7f5930a4a1b3a6a7a005f4d543a5ea5
Author: Ralph Boehme <[email protected]>
Date: Fri Oct 17 12:38:53 2025 +0200
mdssvc: add a test for parsing Spotlight date ranges
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15930
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
commit 3b2b50983901ad5039124b82f149b30675c80a9a
Author: Ralph Boehme <[email protected]>
Date: Wed Oct 15 14:56:51 2025 +0200
mdssvc: reduce a log level to DEBUG
The expression
InRange(*,$time.iso(2024-12-31T23:00:00Z),$time.iso(2025-12-31T23:00:00Z))
in a Spotlight query produces the following log message:
map_fts: Mapping fts [757378800] unexpected op [~]
However, when
elasticsearch:ignore unknown attribute = yes
is set, the parser will ignore the failed expression and continue
parsing given the expression is part of a larger expression like
"subexpression1 OR subexpression2". Avoid spamming the log and reduce
the loglevel when we hit this case.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15930
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
source3/rpc_server/mdssvc/es_parser.y | 9 ++++++++-
source3/rpc_server/mdssvc/test_mdsparser_es.c | 3 +++
2 files changed, 11 insertions(+), 1 deletion(-)
Changeset truncated at 500 lines:
diff --git a/source3/rpc_server/mdssvc/es_parser.y
b/source3/rpc_server/mdssvc/es_parser.y
index 62ca63d90f2..1f1c02ba1a5 100644
--- a/source3/rpc_server/mdssvc/es_parser.y
+++ b/source3/rpc_server/mdssvc/es_parser.y
@@ -219,6 +219,13 @@ FUNC_INRANGE OBRACE attribute COMMA WORD COMMA WORD CBRACE
{
} else {
$$ = map_expr($3, '~', $5, $7);
}
+}
+| FUNC_INRANGE OBRACE attribute COMMA isodate COMMA isodate CBRACE {
+ if ($3 == NULL) {
+ $$ = NULL;
+ } else {
+ $$ = map_expr($3, '~', $5, $7);
+ }
};
attribute:
@@ -412,7 +419,7 @@ static char *map_fts(const struct es_attr_map *attr,
end = ")";
break;
default:
- DBG_ERR("Mapping fts [%s] unexpected op [%c]\n", val, op);
+ DBG_DEBUG("Mapping fts [%s] unexpected op [%c]\n", val, op);
return NULL;
}
diff --git a/source3/rpc_server/mdssvc/test_mdsparser_es.c
b/source3/rpc_server/mdssvc/test_mdsparser_es.c
index a61f84ceaff..5015de82127 100644
--- a/source3/rpc_server/mdssvc/test_mdsparser_es.c
+++ b/source3/rpc_server/mdssvc/test_mdsparser_es.c
@@ -155,6 +155,9 @@ static struct {
}, {
"InRange(kMDItemFSSize,1,2)",
"file.filesize:[1 TO 2]"
+ }, {
+
"InRange(kMDItemContentCreationDate,$time.iso(2024-12-31T23:00:00Z),$time.iso(2025-12-31T23:00:00Z))",
+ "file.created:[2024\\\\-12\\\\-31T23\\\\:00\\\\:00Z TO
2025\\\\-12\\\\-31T23\\\\:00\\\\:00Z]"
}
};
--
Samba Shared Repository