code: public synchronized InternalIndex addOrGetIndex(String name, boolean ordered) {
          InternalIndex index = indexesByName.get(name);
          if (index != null) {
              return index;
          }
  
          String[] components = PredicateUtils.parseOutCompositeIndexComponents(name);
          if (components == null) {
              name = PredicateUtils.canonicalizeAttribute(name);
          } else {
              name = PredicateUtils.constructCanonicalCompositeIndexName(components);
          }
  
          index = indexesByName.get(name);
          if (index != null) {
              return index;
          }
  
          index = indexProvider.createIndex(name, components, ordered, extractors, serializationService, indexCopyBehavior,
                  stats.createPerIndexStats(ordered, usesCachedQueryableEntries));
  
          indexesByName.put(name, index);
          attributeIndexRegistry.register(index);
          converterCache.invalidate(index);
  
          indexes = indexesByName.values().toArray(EMPTY_INDEXES);
          if (components != null) {
              InternalIndex[] oldCompositeIndexes = compositeIndexes;
              InternalIndex[] newCompositeIndexes = Arrays.copyOf(oldCompositeIndexes, oldCompositeIndexes.length + 1);
              newCompositeIndexes[oldCompositeIndexes.length] = index;
              compositeIndexes = newCompositeIndexes;
          }
          return index;
      }
docs: Obtains the existing index or creates a new one (if an index doesn't exist
  yet) for the given name in this indexes instance.
  
  @param name    the name of the index; the passed value might not
  represent a canonical index name (as specified by
  {@link Index#getName()), in this case the method
  canonicalizes it.
  @param ordered {@code true} if the new index should be ordered, {@code
  false} otherwise.
  @return the existing or created index.