Apache Solr form alter add custom fields in search form
You need to add facetsapi module and in form alter add the custom fields. On form submit you need to use 

$keys = $form_state-&gt;getValue('keys');
$custom = $form_state-&gt;getValue('user_custom_field');
$form_state-&gt;setRedirectUrl(Url::fromRoute('search_api_page.en' . '.' . $form_state-&gt;getValue('search_api_page'), array('keys' =&gt; $keys), array('query' =&gt; array('facet_key' =&gt; $custom))));