anchor.diff:  parse_query(_Key, <<>>, QueryArgs) ->
       QueryArgs;
   parse_query(<<"facets">>, Facets, QueryArgs) ->
  -    QueryArgs ++ lists:map(
  -        fun({Name, Props}) ->
  -            {agg, [Name, terms, Props]}
  -        end,
  -        Facets
  -    );
  +    QueryArgs ++ lists:map(fun map_facet/1, Facets);
   parse_query(<<"subject">>, Subjects, QueryArgs) ->
       QueryArgs ++ lists:map(
           fun(Subject) ->
  
positive.code: -export([
      parse_query/3
  ]).
  
  %% @doc Parse Zotonic search query arguments and return Elastic query arguments.
  -spec parse_query(list() | binary(), binary(), proplists:proplist()) -> proplists:proplist().
  
negative.code:     end;
  parse_query(_Key, _Value, QueryArgs) ->
      QueryArgs.
  
  map_facet({Name, [{Type, Props}]}) ->
      {agg, [Name, Type, Props]};
  map_facet({Name, Props}) ->
      map_facet({Name, [{terms, Props}]}).
  