2525#include "mongocrypt-private.h"
2626#include "mongocrypt.h"
2727
28+ /*
29+ * The *TokenSet types corresponds to the following BSON document:
30+ * d: <binary> // EDC derived from data & contention factor token
31+ * s: <binary> // ESC derived from data & contention factor token
32+ * l: <binary> // server derived from data token
33+ * p: <binary> // encrypted token for compaction
34+ */
2835#define DEF_TEXT_SEARCH_TOKEN_SET (Type ) \
2936 typedef struct { \
30- _mongocrypt_buffer_t edcDerivedToken; \
31- _mongocrypt_buffer_t escDerivedToken; \
32- _mongocrypt_buffer_t serverDerivedFromDataToken; \
33- _mongocrypt_buffer_t encryptedTokens; \
37+ _mongocrypt_buffer_t edcDerivedToken; /* d */ \
38+ _mongocrypt_buffer_t escDerivedToken ; /* s */ \
39+ _mongocrypt_buffer_t serverDerivedFromDataToken ; /* l */ \
40+ _mongocrypt_buffer_t encryptedTokens ; /* p */ \
3441 } mc_Text ##Type ##TokenSet_t; \
3542 void mc_Text##Type##TokenSet_init(mc_Text##Type##TokenSet_t *); \
3643 void mc_Text##Type##TokenSet_cleanup(mc_Text##Type##TokenSet_t *); \
@@ -41,6 +48,14 @@ DEF_TEXT_SEARCH_TOKEN_SET(Substring);
4148DEF_TEXT_SEARCH_TOKEN_SET (Suffix );
4249DEF_TEXT_SEARCH_TOKEN_SET (Prefix );
4350
51+ /**
52+ * TextSearchTokenSets corresponds to following BSON document:
53+ *
54+ * e: <TextExactTokenSet> // Holds tokens for exact string search
55+ * s: array<TextSubstringTokenSet> // Holds tokens for substring search
56+ * u: array<TextSuffixTokenSet> // Holds tokens for suffix search
57+ * p: array<TextPrefixTokenSet> // Holds tokens for prefix search
58+ */
4459typedef struct {
4560 mc_TextExactTokenSet_t exact ; // e
4661 mc_array_t substringArray ; // s
@@ -78,6 +93,7 @@ void mc_TextSearchTokenSets_cleanup(mc_TextSearchTokenSets_t *);
7893 * tf: optional<int32> // Trim Factor. Only included for range payloads.
7994 * mn: optional<any> // Index Min. Only included for range payloads.
8095 * mx: optional<any> // Index Max. Only included for range payloads.
96+ * b: optional<TextSearchTokenSets> // Only included for text payloads.
8197 *
8298 * p is the result of:
8399 * Encrypt(
0 commit comments