anchor.diff:          {is_findable, true},
           {is_published, true},
           {cat_exclude_defaults, true},
  -        {cat_exclude_unfindable, true}
  +        {cat_exclude_unfindable, true},
  +        {boost_featured, true}
       ],
       MergedArgs1 = withdefault(DefaultArgs, MergedArgs),
   
  
positive.code:     has_geo,
      is_findable,
      keyword,
      ongoing_on_date
  ]).
  
  %% @doc Observe Zotonic search queries, transform arguments and forward to the
  
negative.code: parse_argument({has_geo, Val}) ->
      parse_argument({has_geo, z_convert:to_bool(Val)});
  
  %% @doc Increase ranking for resources for which is_featured is true.
  parse_argument({boost_featured, false}) ->
      [];
  parse_argument({boost_featured, true}) ->
      score_function(#{
          <<"filter">> => [{is_featured, true}],
          <<"weight">> => 2
      });
  
  parse_argument(Arg) ->
      [Arg].
  
  %% @doc Add Elasticsearch custom score function.
  score_function(Body) ->
      fun(Context) ->
          case z_module_manager:active(mod_elasticsearch, Context) of
              false ->
                  %% Custom score function only works on Elasticsearch
                  [];
              true ->
                  [{score_function, Body}]
          end
      end.
  