Q: Inner join overrides Advanced Custom Fields plugin's get_field I have this search that I made with inner join and where clause. I no longer get get_field() values, they all return false. How can I get ACF to work again? It must be something silly that I don't know about.
function get_lat_long($query)
{
    if ( !is_admin() && $query->is_main_query() ) {
        if ($query->is_search) {
        $query->set('post_type', 'doctor');
        global $wpdb;
            if(isset($_GET['zipcode']) && isset($_GET['radius'])){
                $zipcode = (int)$_GET['zipcode'];
                $radius = (int)$_GET['radius'];

                $lat_long = $wpdb->get_results("SELECT lat, lon FROM zips WHERE zip_code = '$zipcode' LIMIT 1");
                if($lat_long):
                    global $minmax;
                    $minmax = bar_get_nearby( $lat_long[0]->lat, $lat_long[0]->lon, 0, $radius );
                    $minLat = $minmax['min_latitude'];
                    $maxLat = $minmax['max_latitude'];
                    $minLon = $minmax['min_longitude'];
                    $maxLon = $minmax['max_longitude'];
                    add_action( 'min_lat', function(){
                        echo $minLat;
                    });

                    add_filter( 'posts_where', function( $content ) use ( $minmax ){
                        $where = " AND ( ( (geo.lat BETWEEN '$minmax[min_latitude]' AND '$minmax[max_latitude]') AND (geo.lng BETWEEN '$minmax[min_longitude]' AND '$minmax[max_longitude]') )  )";
                        return $where;
                    });

                    add_filter( 'posts_join', function(){
                        global $wpdb;
                        $join = " INNER JOIN wp_my_geodata AS geo ON ($wpdb->posts.ID = geo.post_id)";
                        return $join;
                    });
                endif;
            }else{
                return;
            }
        }
    }
}

add_filter( 'pre_get_posts', 'get_lat_long');

The part that causes the issue is 
                        add_filter( 'posts_where', function( $content ) use ( $minmax ){
                            $where = " AND ( ( (geo.lat BETWEEN '$minmax[min_latitude]' AND '$minmax[max_latitude]') AND (geo.lng BETWEEN '$minmax[min_longitude]' AND '$minmax[max_longitude]') )  )";
                            return $where;
                        });

                        add_filter( 'posts_join', function(){
                            global $wpdb;
                            $join = " INNER JOIN wp_my_geodata AS geo ON ($wpdb->posts.ID = geo.post_id)";
                            return $join;
                        });

I'm getting correct results, just not able to use get_field('field_name'); anymore.

A: Don't forget that when you are adding a filter it will stay there for all subsequent request. 
I would suggest you remove the closure and do something like this:
function x_example( $input ) {
  remove_filter( 'posts_where', 'x_example' );
  return $input;
}

add_filter( 'posts_where', 'x_example' );

You will have to do the same thing for the posts_join filter.
Update
As pointed by @bonger you could also keep the closure using the following method:
$closure = function( $input ) use ( &$closure ) {
   remove_filter( 'posts_where', $closure );
   return $input;
};

add_filter( 'posts_where', $closure );

