Advanced search cleanup

Document the /advanced_search endpoint and remove some dead code.