@Override
          public void run2() {
            try {
              Cache cache = getCache();
              QueryService qs = cache.getQueryService();
              Region region = cache.getRegion(rrRegionName);
              LogWriter logger = cache.getLogger();
              if (null != fromClause) {
                logger.info("Test Creating index with Name : [ " + indexName + " ] "
                    + "IndexedExpression : [ " + indexedExpression + " ] Alias : [ " + alias
                    + " ] FromClause : [ " + fromClause + " " + alias + " ] ");
                Index parIndex =
                    qs.createIndex(indexName, IndexType.FUNCTIONAL, indexedExpression, fromClause);
                logger.info("Index creted on replicated region : " + parIndex);

              } else {
                logger.info("Test Creating index with Name : [ " + indexName + " ] "
                    + "IndexedExpression : [ " + indexedExpression + " ] Alias : [ " + alias
                    + " ] FromClause : [ " + region.getFullPath() + " " + alias + " ] ");
                Index parIndex = qs.createIndex(indexName, IndexType.FUNCTIONAL, indexedExpression,
                    region.getFullPath() + " " + alias);
                logger.info("Index creted on replicated region : " + parIndex);
              }


            } catch (Exception ex) {
              Assert.fail("Creating Index in this vm failed : ", ex);
            }
          }
This function defines a appropriate index on a PR given the name and other parameters.
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java