Exposed filter - based on first three number in Zipcode?
Please check this link

Is has an example how to implement query alter having exposed filters.

function hook_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
  // (Example assuming a view with an exposed filter on node title.)
  // If the input for the title filter is a positive integer, filter against
  // node ID instead of node title.
  if ($view-&gt;id() == 'my_view' &amp;&amp; is_numeric($view-&gt;exposed_raw_input['title']) &amp;&amp; $view-&gt;exposed_raw_input['title'] &gt; 0) {
    // Traverse through the 'where' part of the query.
    foreach ($query-&gt;where as &amp;$condition_group) {
      foreach ($condition_group['conditions'] as &amp;$condition) {
        // If this is the part of the query filtering on title, chang the
        // condition to filter on node ID.
        if ($condition['field'] == 'node.title') {
          $condition = array(
            'field' =&gt; 'node.nid',
            'value' =&gt; $view-&gt;exposed_raw_input['title'],
            'operator' =&gt; '=',
          );
        }
      }
    }
  }
}