MCPcopy Create free account
hub / github.com/documentdb/documentdb / GenerateRootTerm

Function GenerateRootTerm

pg_documentdb/src/opclass/gin_index_term.c:2193–2205  ·  view source on GitHub ↗

* This is the root term that all documents get when the indexed path exists. * We pick a term that points to a path that is illegal ('') * and give it to all terms. This allows us to answer questions * on complement sets (e.g. NOT operators) from the index. */

Source from the content-addressed store, hash-verified

2191 * on complement sets (e.g. NOT operators) from the index.
2192 */
2193Datum
2194GenerateRootTerm(const IndexTermCreateMetadata *termData)
2195{
2196 pgbsonelement element = { 0 };
2197 element.path = "";
2198 element.pathLength = 0;
2199 element.bsonValue.value_type = BSON_TYPE_MINKEY;
2200
2201 /* Can't mark this as metadata due to back-compat. This is okay coz this is legacy. */
2202 IndexTermMetadata termMetadata = IndexTermNoMetadata;
2203 return PointerGetDatum(SerializeBsonIndexTermCore(&element, termData,
2204 termMetadata).indexTermVal);
2205}
2206
2207
2208Datum

Callers 8

GenerateTermsFunction · 0.85
GenerateNegationTermsFunction · 0.85
AddNullArrayOpTermsFunction · 0.85
GinBsonExtractQueryNotInFunction · 0.85

Calls 1

Tested by

no test coverage detected