Set default value to fix 500 on search error

The except code should set the default value for
the coming code, but c.search_facets was not
initialized properly and c.search_facets.keys()
would fail. The whole section should be refactored
to a smaller try-except-block.