if(minDistance != null) { min_distance = ((IntegerValue) minDistance.eval(nodes).convertTo(Type.INTEGER)).getInt(); } try { getSearchTerms(context, searchArg); } catch (EXistException e) { throw new XPathException(e.getMessage(), e); } NodeSet hits = processQuery(nodes); if (hits == null) return Sequence.EMPTY_SEQUENCE;  boolean hasWildcards = false; for(int i = 0; i < terms.length; i++) { hasWildcards |= NativeTextEngine.containsWildcards(terms[i]); } return hasWildcards ? patternMatch(context, hits) : exactMatch(context, hits); }
    public Sequence evalQuery(			      String searchArg,			      NodeSet nodes)	throws XPathException {	if(maxDistance != null) {	    max_distance = ((IntegerValue) maxDistance.eval(nodes).convertTo(Type.INTEGER)).getInt();	}	if(minDistance != null) {	    min_distance = ((IntegerValue) minDistance.eval(nodes).convertTo(Type.INTEGER)).getInt();	}	try {	    getSearchTerms(context, searchArg);	} catch (EXistException e) {	    throw new XPathException(e.getMessage(), e);	}	NodeSet hits = processQuery(nodes);	if (hits == null)	    return Sequence.EMPTY_SEQUENCE;	    	boolean hasWildcards = false;	for(int i = 0; i < terms.length; i++) {	    hasWildcards |=		NativeTextEngine.containsWildcards(terms[i]);	}	return hasWildcards	    ? patternMatch(context, hits)	    : exactMatch(context, hits);    }