From eec6487f5996b69a385bf8e3174f35841140e157 Mon Sep 17 00:00:00 2001 From: Magnus Kessler Date: Thu, 2 Feb 2017 12:40:40 +0000 Subject: [PATCH] Speed up partition_list query Use 'facet.method=enum' for much reduced query times, and avoid overhead of returning unused actual query results and headers. Fixes https://github.com/basho/yokozuna/issues/720 --- src/yz_solr.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/yz_solr.erl b/src/yz_solr.erl index b600ffb9..afc9beb5 100644 --- a/src/yz_solr.erl +++ b/src/yz_solr.erl @@ -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),