}
for(int i=query.offset; i<result.totalHits && i<(query.offset + query.limit); i++){
Element el = new Element();
el.setIndex(query.index);
Document d = multiSearcher.doc(result.scoreDocs[i].doc,fieldSelector);
el.setKey(d.get(DOCUMENT_KEY));
if(query.isSetPayload() && query.payload)
el.setPayload(d.get(PAYLOAD_KEY));
response.addToElements(el);
}
return response;