// for each document id range, scan the index to find matches
for (final Range range : ranges) {
final byte[] fromKey = computeKey(type, qname, range.start);
final byte[] toKey = computeKey(type, qname, range.end + 1);
final IndexQuery query = new IndexQuery(IndexQuery.RANGE, new Value(fromKey), new Value(toKey));
try {
lock.acquire(Lock.READ_LOCK);
index.btree.query(query, callback);
} catch (final LockException e) {
NativeStructuralIndex.LOG.warn("Lock problem while searching structural index: " + e.getMessage(), e);