This will return 404 but only because the URL is wrong. It must be `/solr/<index>/select` or `/search/<index>`. There should be no need for the accept header either.

You can use `yz_rt:search(HP, BadIndex, <<"field">>, <<"term">>)` to search instead of building the URL yourself.