Ejemplo n.º 1
0
  public long getFiles(
      AbstractSearchRequest searchRequest,
      ItemField orderBy,
      boolean orderAsc,
      long start,
      long rows,
      List<FileItem> list)
      throws SearchLibException {
    searchRequest.setStart((int) start);
    searchRequest.setRows((int) rows);
    try {
      if (orderBy != null) orderBy.addSort(searchRequest, !orderAsc);
      AbstractResultSearch<?> result = (AbstractResultSearch<?>) dbClient.request(searchRequest);
      if (list != null) for (ResultDocument doc : result) list.add(getNewFileItem(doc));
      return result.getNumFound();

    } catch (IOException e) {
      throw new SearchLibException(e);
    } catch (RuntimeException e) {
      throw new SearchLibException(e);
    } catch (URISyntaxException e) {
      throw new SearchLibException(e);
    }
  }