private List<SearchHit> limitList(int limit,List<SearchHit> hitList){
  if (LOG.isDebugEnabled()) {
    LOG.debug("Reducing elastic search result list of size:\t" + hitList.size() + " to "+ limit+ " elements");
  }
  SearchHit[] limitedHits=new SearchHit[limit];
  System.arraycopy(hitList.toArray(new SearchHit[hitList.size()]),0,limitedHits,0,limit);
  return Arrays.asList(limitedHits);
}

private List < SearchHit > limitList ( int limit , List < SearchHit > hitList ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Reducing elastic search result list of size:\t" + hitList . size ( ) + " to " + limit + " elements" ) ; } SearchHit [ ] limitedHits = new SearchHit [ limit ] ; System . arraycopy ( hitList . toArray ( new SearchHit [ hitList . size ( ) ] ) , 0 , limitedHits , 0 , limit ) ; return Arrays . asList ( limitedHits ) ; }
reduce size of hitlist to given limit ( cuts of all elements after position $ limit )
