anchor.diff:      gen_server:cast(Pid, Msg).
   
   
  +%% Clear the search index
  +clear_index(Context) ->
  +    DefaultConnection = ?DEFAULT_CONNECTION ++ z_convert:to_list(z_context:site(Context)) ++ "/",
  +    SolrUrl = m_config:get_value(?MODULE, solr, DefaultConnection, Context),
  +    Curl = fun(Link)->
  +        Cmd = "curl -X GET \"" ++ Link ++ "\"",
  +        os:cmd(Cmd)
  +    end,
  +    Curl(SolrUrl ++ "update?stream.body=<delete><query>*:*</query></delete>"),
  +    Curl(SolrUrl ++ "update?stream.body=<commit/>"),
  +    Curl(SolrUrl ++ "update?stream.body=<optimize/>").
  +
  +    
   %%====================================================================
   %% gen_server callbacks
   %%====================================================================
  
positive.code: -export([
      pid_observe_search_query/3,
      pid_observe_rsc_pivot_done/3,
      pid_observe_rsc_delete/3
  ]).
  
  -include("zotonic.hrl").
  
  -record(state, {context, solr, default_search, java_pid}).
  
  
  %%====================================================================
  %% API
  
negative.code:             nop
      end,
  
      DefaultConnection = ?DEFAULT_CONNECTION ++ z_convert:to_list(z_context:site(Context)) ++ "/",
      SolrUrl = m_config:get_value(?MODULE, solr, DefaultConnection, Context),
      SearchUrl = z_convert:to_list(SolrUrl) ++ "select",
      MltUrl = z_convert:to_list(SolrUrl) ++ "mlt",
  