Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up partition_list query #721

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/yz_solr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,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">>},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It must not matter that some of these params are strings and others binaries. Should it be consistent?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I shouldn't matter. The omitHeader line was actually taken from

{omitHeader, <<"true">>},
(to keep some consistency in the code base). I didn't change the other occurences of plain strings to avoid too much code churn. Yet another variant exists at
{omitHeader,true}
, where atoms are used.

I propose to follow this up with a separate patch that introduces consistent usage of one of these forms.

{"facet.field", ?YZ_PN_FIELD_S},
{wt, "json"}],
Encoded = mochiweb_util:urlencode(Params),
Expand Down