boolean verifyEntryAndIndexValue(RegionEntry re, Object value, ExecutionContext context) {
    IMQEvaluator evaluator = (IMQEvaluator) getEvaluator();
    List valuesInRegion = null;
    Object valueInIndex = null;

    try {
      // In a RegionEntry key and Entry itself can not be modified else RegionEntry itself will
      // change. So no need to verify anything just return true.
      if (evaluator.isFirstItrOnKey()) {
        return true;
      } else if (evaluator.isFirstItrOnEntry()) {
        valuesInRegion = evaluateIndexIteratorsFromRE(re, context);
        valueInIndex = verifyAndGetPdxDomainObject(value);
      } else {
        RegionEntryContext regionEntryContext = context.getPartitionedRegion() != null
            ? context.getPartitionedRegion() : (RegionEntryContext) region;
        Object val = re.getValueInVM(regionEntryContext);
        if (val instanceof CachedDeserializable) {
          val = ((CachedDeserializable) val).getDeserializedValue(getRegion(), re);
        }
        val = verifyAndGetPdxDomainObject(val);
        valueInIndex = verifyAndGetPdxDomainObject(value);
        valuesInRegion = evaluateIndexIteratorsFromRE(val, context);
      }
    } catch (Exception e) {
      if (logger.isDebugEnabled()) {
        logger.debug(
            "Exception occurred while verifying a Region Entry value during a Query when the Region Entry is under update operation",
            e);
      }
    }

    // We could have many index keys available in one Region entry or just one.
    if (!valuesInRegion.isEmpty()) {
      for (Object valueInRegion : valuesInRegion) {
        if (compareStructWithNonStruct(valueInRegion, valueInIndex)) {
          return true;
        }
      }
      return false;
    } else {
      // Seems like value has been invalidated.
      return false;
    }
  }
This will verify the consistency between RegionEntry and IndexEntry. RangeIndex has following
entry structure,

IndexKey --> [RegionEntry, [Iterator1, Iterator2....., IteratorN]]

Where Iterator1 to IteratorN are iterators defined in index from clause.

For example: "/portfolio p, p.positions.values pos" from clause has two iterators where p is
independent iterator and pos is dependent iterator.

Query iterators can be a subset, superset or exact match of index iterators. But we take query
iterators which are matching with index iterators to evaluate RegionEntry for new value and
compare it with index value which could be a plain object or a Struct.

Note: Struct evaluated from RegionEntry can NOT have more field values than Index Value Struct
as we filter out iterators in query context before evaluating Struct from RegionEntry.

@return True if Region and Index entries are consistent.
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java