for (int i = 0; i < qnames.size(); i++) {
QName qname = qnames.get(i);
NGramQNameKey key = new NGramQNameKey(collectionId, qname, index.getBrokerPool().getSymbols(), query);
final Lock lock = index.db.getLock();
try {
lock.acquire(Lock.READ_LOCK);
SearchCallback cb = new SearchCallback(contextId, query, ngram, docs, contextSet, context, result, axis == NodeSet.ANCESTOR);
int op = query.codePointCount(0, query.length()) < getN() ? IndexQuery.TRUNC_RIGHT : IndexQuery.EQ;
index.db.query(new IndexQuery(op, key), cb);
} catch (LockException e) {
LOG.warn("Failed to acquire lock for '" + index.db.getFile().getName() + "'", e);