String searchArg, NodeSet nodes) throws XPathException { if(distance != null) max_distance = ((IntegerValue)distance.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);
String searchArg, NodeSet nodes) throws XPathException { if(maxDistance != null) { max_distance = ((IntegerValue) maxDistance.eval(nodes).convertTo(Type.INTEGER)).getInt();
	public Sequence evalQuery(		String searchArg,		NodeSet nodes)		throws XPathException {		if(distance != null)			max_distance = ((IntegerValue)distance.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);	}