protected Document doc(final String shardName, final int docId, final String[] fieldNames) throws IOException {
final Searchable searchable = getSearcherByShard(shardName);
if (fieldNames == null) {
return searchable.doc(docId);
} else {
return searchable.doc(docId, new MapFieldSelector(fieldNames));
}
}
/**
* Rewrites a query for the given shards