code: public List<OntologyTerm> findOntologyTerms(
        List<String> ontologyIds, Set<String> terms, int pageSize) {
      List<QueryRule> rules = new ArrayList<>();
      for (String term : terms) {
        if (!rules.isEmpty()) {
          rules.add(new QueryRule(Operator.OR));
        }
        rules.add(
            new QueryRule(OntologyTermMetadata.ONTOLOGY_TERM_SYNONYM, Operator.FUZZY_MATCH, term));
      }
      rules =
          Arrays.asList(
              new QueryRule(ONTOLOGY, Operator.IN, ontologyIds),
              new QueryRule(Operator.AND),
              new QueryRule(rules));
  
      final List<QueryRule> finalRules = rules;
      Iterable<Entity> termEntities =
          () ->
              dataService
                  .findAll(ONTOLOGY_TERM, new QueryImpl<>(finalRules).pageSize(pageSize))
                  .iterator();
  
      return Lists.newArrayList(
          Iterables.transform(termEntities, OntologyTermRepository::toOntologyTerm));
    }
docs: Finds {@link OntologyTerm}s within {@link Ontology}s.
  
  @param ontologyIds IDs of the {@link Ontology}s to search in
  @param terms {@link List} of search terms. the {@link OntologyTerm} must match at least one of
  these terms
  @param pageSize max number of results
  @return {@link List} of {@link OntologyTerm}s