I got a strange error on the creation of the Search Service Application in SharePoint 2013. It complains that the “indexLocation” parameter cannot be null.
But there is no such parameter while (just) creating Search Service Application. According to this TechNet, the only required parameters are name and application pool.
I solved this issue by starting Search Host Controller Service as well as Search Query and Site Settings Service before running New-SPEnterpriseSearchServiceApplication.
You can start these SharePoint services from Central Administration (Application Management > Manage Services on Server).
Alternatively, you can open SharePoint Management Shell and enter:
Get-SPEnterpriseSearchServiceInstance -Local | Start-SPEnterpriseSearchServiceInstance; Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Local | Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance;
I will be posting a complete script to configure Search Service Application soon.