anchor.diff:  						 {ok,JsonStruct2} -> 	 
   							 Update = case lib_json:field_value_exists(JsonStruct2, "_source.outputlist[*].input", Input) of
   										  true ->
  -											  "{\"script\" : \"for(int i=0;i < ctx._source.outputlist.size(); i++){if (ctx._source.outputlist[i].input == newinput){if (ctx._source.outputlist[i].output == newoutputlist) {ctx._source.outputlist.remove((Object) ctx._source.outputlist[i]); i = ctx._source.outputlist.size();} else {for(int k=0;k < ctx._source.outputlist[i].output.size(); k++) {if (ctx._source.outputlist[i].output[k] == newoutput) {ctx._source.outputlist[i].output.remove((Object) ctx._source.outputlist[i].output[k]); k = ctx._source.outputlist[i].output.size();}}}}}\", \"params\":{\"newinput\":\"" ++ lib_json:to_string(Input) ++ "\",  \"newoutputlist\":[{\"output_id\":[\""++URI++"\",\""++ User++"\"],\"output_type\":\"uri\"}],  \"newoutput\":{\"output_id\":[\""++URI++"\",\""++ User++"\"],\"output_type\":\"uri\"}}}";
  +											  "{\"script\" : \"for(int i=0;i < ctx._source.outputlist.size(); i++){if (ctx._source.outputlist[i].input == newinput){if (ctx._source.outputlist[i].output == newoutputlist) {ctx._source.outputlist.remove((Object) ctx._source.outputlist[i]); i = ctx._source.outputlist.size();} else {for(int k=0;k < ctx._source.outputlist[i].output.size(); k++) {if (ctx._source.outputlist[i].output[k] == newoutput) {ctx._source.outputlist[i].output.remove((Object) ctx._source.outputlist[i].output[k]); k = ctx._source.outputlist[i].output.size();}}}}}\", \"params\":{\"newinput\":\"" ++ input_to_string(Input) ++ "\",  \"newoutputlist\":[{\"output_id\":[\""++URI++"\",\""++ User++"\"],\"output_type\":\"uri\"}],  \"newoutput\":{\"output_id\":[\""++URI++"\",\""++ User++"\"],\"output_type\":\"uri\"}}}";
   										  false ->
   											  erlang:display("Error: input not in file"),
   											  "{}"
  
positive.code: create_stream_query([StreamId|Rest],Acc) ->
  	create_stream_query(Rest," " ++ StreamId ++ Acc).
  
  %% @doc
  %% Function: get_es_id/2
  %% Purpose: Used to get the id of the document that
  
negative.code: 				{ok,JsonStruct2} -> 
  					Update = case lib_json:field_value_exists(JsonStruct2, "_source.outputlist[*].input", Input) of
  								 true ->
  									 "{\"script\" : \"for(int i=0;i < ctx._source.outputlist.size(); i++){if (ctx._source.outputlist[i].input == newinput && !ctx._source.outputlist[i].output.contains(newoutput)){ctx._source.outputlist[i].output += newoutput; i = ctx._source.outputlist.size();}}\", \"params\":{\"newinput\":" ++  input_to_string(Input)++ ", \"newoutput\":{\"output_id\":[\""++URI++"\",\""++ User++"\"],\"output_type\":\"uri\"}}}";
  								 false ->
  									 "{\"script\" : \"ctx._source.outputlist += newelement\", \"params\":{\"newelement\":{\"input\" : "++ input_to_string(Input) ++ ", \"output\":[{\"output_id\":[\""++URI++"\",\""++ User++"\"],\"output_type\":\"uri\"}]}}}"
  							 end,
  					case api_help:update_doc(?INDEX, "trigger", EsId, Update) of % Update document in es with the new user
  						{error, {Code4, Body4}} -> 
  