The indexing feature optionalPathTerms allows you to create an index on a collection in which some objects along the path do not have an instance variable present in the index path. The index is created on the objects in which the instance variable is present without erroring on the object in which is it absent.
However, if an object along the path that does not have the instance variable is replaced by an object that does have it, the optionalPathTerm index is not updated to reflect the presence of the objects that are now reachable.
This failure is not detected by index audit.
For collections with optionalPathTerm indexes, if objects on the path change, you should rebuild the index.
Last updated: 7/19/23