Add dependent field in system.xml in Magento2

<field id="ajaxsearch_type" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
 <label>Search Type</label>
 <source_model>Dys\Ajaxsearch\Model\Searchtype</source_model>
 <depends>
 <field id="allow_ajaxsearch">1</field>
 </depends>
</field>