docs: public StringIndex getNameIndex() {
          try {
              if (nameIndex == null) {
                  FileSystemResource res = new FileSystemResource(context.getFileSystem(), RES_NAME_INDEX);
                  if (res.exists()) {
                      nameIndex = super.getNameIndex();
                  } else {
                      // create db nameindex
                      nameIndex = createDbNameIndex();
                  }
              }
              return nameIndex;
          } catch (Exception e) {
              IllegalStateException exception =
                  new IllegalStateException("Unable to create nsIndex");
              exception.initCause(e);
              throw exception;
          }
      }