LOGGER.log(Level.TRACE, "Random mid[{0}]", mid);
Query query = new Query();
query.setFilter(
CompositeFilterOperator.and(new PropertyFilter(Article.ARTICLE_RANDOM_DOUBLE, FilterOperator.GREATER_THAN_OR_EQUAL, mid),
new PropertyFilter(Article.ARTICLE_RANDOM_DOUBLE, FilterOperator.LESS_THAN_OR_EQUAL, mid),
new PropertyFilter(Article.ARTICLE_IS_PUBLISHED, FilterOperator.EQUAL, true)));
query.setCurrentPageNum(1);
query.setPageSize(fetchSize);
query.setPageCount(1);
final JSONObject result1 = get(query);
final JSONArray array1 = result1.optJSONArray(Keys.RESULTS);
final List<JSONObject> list1 = CollectionUtils.<JSONObject>jsonArrayToList(array1);
ret.addAll(list1);
final int reminingSize = fetchSize - array1.length();
if (0 != reminingSize) { // Query for remains
query = new Query();
query.setFilter(
CompositeFilterOperator.and(new PropertyFilter(Article.ARTICLE_RANDOM_DOUBLE, FilterOperator.GREATER_THAN_OR_EQUAL, 0D),
new PropertyFilter(Article.ARTICLE_RANDOM_DOUBLE, FilterOperator.LESS_THAN_OR_EQUAL, mid),
new PropertyFilter(Article.ARTICLE_IS_PUBLISHED, FilterOperator.EQUAL, true)));
query.setCurrentPageNum(1);
query.setPageSize(reminingSize);
query.setPageCount(1);
final JSONObject result2 = get(query);