Skip to content

Commit

Permalink
Speed up partition_list query
Browse files Browse the repository at this point in the history
Use 'facet.method=enum' for much reduced query times, and avoid overhead
of returning unused actual query results and headers.

Fixes basho#720
  • Loading branch information
Magnus Kessler committed Feb 2, 2017
1 parent 6cf80ad commit eec6487
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/yz_solr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,11 @@ prepare_json(Docs) ->
-spec partition_list(index_name()) -> {ok, Resp::binary()} | {error, term()}.
partition_list(Core) ->
Params = [{q, "*:*"},
{rows, 0},
{omitHeader, <<"true">>},
{facet, "on"},
{"facet.mincount", "1"},
{"facet.method", <<"enum">>},
{"facet.field", ?YZ_PN_FIELD_S},
{wt, "json"}],
Encoded = mochiweb_util:urlencode(Params),
Expand Down

0 comments on commit eec6487

Please sign in to comment.