Limited scroll search from java

Hi,
we have many indexes each with one or more aliases each with one shard and
each created from same template.
I want to fire scroll search with limit to one or more indexes by one or
more aliases. If I set a size parameter its applied to result from a shard
not to whole result which i've expected. If i set a post limit filter then
no data are returned.
I want to set size to ONE and get ONE result even if i hit a 15 shards. Now
i gets 15 results or nothing.
What's wrong?

String[] aliases = getAliases(input);
SearchRequestBuilder requestBuilder = esConnection.prepareSearch(aliases);

BoolQueryBuilder boolQuery = boolQuery();
boolQuery =
boolQuery.must(rangeQuery("created_time").from(input.getTimeFrom()).to(input.getTimeTo()));
...
requestBuilder.setQuery(boolQuery);

requestBuilder.setSearchType(SearchType.SCAN);
requestBuilder.setTypes("type");
requestBuilder.addSort("created_time", SortOrder.DESC);
requestBuilder.setExplain(false);
requestBuilder.setFetchSource(false);
requestBuilder.setNoFields();
requestBuilder.setSize(input.getLimit());
//
requestBuilder.setPostFilter(FilterBuilders.limitFilter(input.getLimit()));
requestBuilder.setScroll(new TimeValue(1, TimeUnit.MINUTES));

ListenableActionFuture execute = requestBuilder.execute();
SearchResponse searchResponse = execute.actionGet();

searchResponse =
esConnection.prepareSearchScroll(searchResponse.getScrollId())
.execute().actionGet();

SearchHits hits = searchResponse.getHits();
List result = new ArrayList<>();
for (SearchHit searchHit : hits.getHits()) {
result.add(searchHit.getId());
}

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/fa959fb9-731a-43a4-b89f-939bd245fa9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.