286 switch from solr to elastic search

Should do the first fixes for the search with elasticsearch instead of solr
Style/GuardClause: Use a guard clause instead of wrapping the code inside a conditional expression.