searchsortedfirst(A, x, lo, hi, order) searches only in the interval
lo:hi. In order to get the same result as for the view, you need to shift the indices again, i.e. subtract
(lo-1). You can also use this version to speed up the search, if you already know something about the position of your target.
For some unclear reason, this variant is not exported with all the fancy default argument bells-and-whistles. This means that you need to provide the order explicitly. This is done by
Base.Order.ForwardOrdering(), which is the default used by
searchsortedfirst(A, x). If you used keyword parameters (e.g.
searchsortedfirst(A, x; by=fun)) then you would need to look into sort.jl in order to see how to provide these.