Apache Solr form alter add custom fields in search form I wanted to alter the apache solr search form by adding my own custom textfields, dropdowns. I tried using the regular form alter hook but it works only for the Core search i.e custom fields appear for core search. On the Apache Solr form these form elements are not getting rendered.

Is there a way to achieve this kind of functionality ? Or any other Apache solr hook perhaps.
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))));