fix searchsorted for sorted segments of arrays