public FieldRange find() {
		BigInteger step = forward ? BigInteger.ONE : BigInteger.ONE.negate();
		BigInteger maxIndex = model.getNumIndexes().subtract(BigInteger.ONE);
		FieldRange found = findInIndices(cur.getIndex(),
			forward ? maxIndex : BigInteger.ZERO, step);
		if (found != null) {
			return found;
		}
		if (!wrap) {
			return null;
		}
		return findInIndices(forward ? BigInteger.ZERO : maxIndex,
			cur.getIndex(), step);
	}
Execute the search

@return the range covering the found term, or null if not found
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/TerminalFinder.java