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

Function MatchIndexPathForText

pg_documentdb/src/opclass/index_support.c:5208–5224  ·  view source on GitHub ↗

* Matches the indexPath for $text query. It just checks if the index used * is a text index, as there can only be at max one text index for a collection. */

Source from the content-addressed store, hash-verified

5206 * is a text index, as there can only be at max one text index for a collection.
5207 */
5208static bool
5209MatchIndexPathForText(IndexPath *indexPath, void *matchContext)
5210{
5211 if (IsBsonRegularIndexAm(indexPath->indexinfo->relam) &&
5212 indexPath->indexinfo->ncolumns > 0)
5213 {
5214 for (int ind = 0; ind < indexPath->indexinfo->ncolumns; ind++)
5215 {
5216 if (IsTextPathOpFamilyOid(indexPath->indexinfo->relam,
5217 indexPath->indexinfo->opfamily[ind]))
5218 {
5219 return true;
5220 }
5221 }
5222 }
5223 return false;
5224}
5225
5226
5227pg_attribute_noreturn()

Callers

nothing calls this directly

Calls 2

IsBsonRegularIndexAmFunction · 0.85
IsTextPathOpFamilyOidFunction · 0.85

Tested by

no test coverage detected