Пример #1
0
  @Override
  public List<SearchResult> search(
      final SessionIdentifier sessionIdentifier, final String query, final int maxResults) {

    // search in one component
    {
      final int pos = query.indexOf(':');
      if (pos != -1) {
        final String name = query.substring(0, pos);
        final SearchServiceComponent search = searchServiceComponentRegistry.get(name);
        if (search != null) {
          final List<SearchServiceComponent> searchServiceComponents = Arrays.asList(search);
          return search(
              searchServiceComponents,
              query.substring(pos + 1).trim(),
              sessionIdentifier,
              maxResults);
        }
      }
    }

    final List<SearchServiceComponent> searchServiceComponents =
        new ArrayList<SearchServiceComponent>(searchServiceComponentRegistry.getAll());
    logger.trace("searchServiceComponents " + searchServiceComponents.size());
    return search(searchServiceComponents, query, sessionIdentifier, maxResults);
  }
Пример #2
0
 @Override
 public List<String> getSearchComponentNames() {
   final List<String> result = new ArrayList<String>();
   for (final SearchServiceComponent cs : searchServiceComponentRegistry.getAll()) {
     result.add(cs.getClass().getName());
   }
   return result;
 }