Skip to content

Instantly share code, notes, and snippets.

@tonysun83
Created October 1, 2014 18:19
Show Gist options
  • Save tonysun83/5697821c6565e5d34b71 to your computer and use it in GitHub Desktop.
Save tonysun83/5697821c6565e5d34b71 to your computer and use it in GitHub Desktop.
go(DbName, DDoc, IndexName, QueryArgs, Counters, Bookmark,HttpResp) ->
{Workers, _} = lists:unzip(Counters),
#index_query_args{limit = Limit, sort = Sort} = QueryArgs,
Replacements = fabric_view:get_shard_replacements(DbName, Workers),
State = #state{
limit = Limit,
sort = Sort,
top_docs = #top_docs{total_hits=0,hits=[]},
counters = Counters,
start_args = [DDoc, IndexName, QueryArgs],
replacements = Replacements,
procs = 0,
http_resp=HttpResp
},
% RexiMon = fabric_util:create_monitors(Workers),
case rexi_utils:recv(Workers, #shard.ref, fun handle_message/3,
State, infinity, 1000 * 60 * 60) of
{ok,search_all_complete} ->
{ok,search_all_complete};
{error, Reason} ->
twig:log(error, "Error: ~p", [Reason]),
{error, Reason}
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment