Skip to content

replace, not merge search parameters #755

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

Open
wants to merge 1 commit into
base: develop-2.9
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
9 changes: 8 additions & 1 deletion src/yz_solr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,14 @@ dist_search(Core, Headers, Params) ->
ShardFrags = [shard_frag(Core, HostPort) || HostPort <- HostPorts],
ShardFrags2 = string:join(ShardFrags, ","),
ShardFQs = build_shard_fq(FilterPairs, Mapping),
Params2 = Params ++ [{shards, ShardFrags2}|ShardFQs],
%% @todo normalise and filter everything that cannot be ever a valid solr
%% param. It should be possible. The only problematic thing is
%% $substitutions, but they can have their own prefix namespace, like
%% param-foo, param-bar.
%% For now: just make sure we override shards
Params2 = lists:ukeymerge(1,
lists:keysort(1, [{"shards", ShardFrags2}|ShardFQs]),
lists:keysort(1, Params)),
search(Core, Headers, Params2);
{error, _} = Err ->
Err
Expand Down