code: @Override
      public IterableResult<Extension> search(String pattern, int offset, int nb) throws SearchException
      {
          UriBuilder builder = this.searchUriBuider.clone();
  
          builder.queryParam(Resources.QPARAM_LIST_START, offset);
          builder.queryParam(Resources.QPARAM_LIST_NUMBER, nb);
          if (pattern != null) {
              builder.queryParam(Resources.QPARAM_SEARCH_QUERY, pattern);
          }
  
          ExtensionsSearchResult restExtensions;
          try {
              restExtensions = (ExtensionsSearchResult) getRESTObject(builder);
          } catch (Exception e) {
              throw new SearchException("Failed to search extensions based on pattern [" + pattern + "]", e);
          }
  
          List<Extension> extensions = new ArrayList<Extension>(restExtensions.getExtensions().size());
          for (ExtensionVersion restExtension : restExtensions.getExtensions()) {
              extensions.add(new XWikiExtension(this, restExtension, this.licenseManager, this.factory));
          }
  
          return new CollectionIterableResult<Extension>(restExtensions.getTotalHits(), restExtensions.getOffset(),
              extensions);
      }
docs: Searchable