Skip to content

Commit

Permalink
Merge pull request #3093 from alphagov/licences-force-ltr
Browse files Browse the repository at this point in the history
Add optional parameter that allows forcing LTR on on the licences path.
  • Loading branch information
KludgeKML authored Jun 28, 2023
2 parents 9f4d135 + 407ca91 commit 5fbef88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/lib/search/query_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def ab_query
# We're using the ab test relevance:disable params here to turn off LTR for this
# finder. It would probably be best in the long run to create a specific way of
# doing this that uses a proper parameter, but we can't do that at the moment.
ab_params.merge!("relevance" => "disable") if licence_transaction_path?
ab_params.merge!("relevance" => "disable") if licence_transaction_path? && !force_ltr?
ab_params.any? ? { "ab_tests" => ab_params.map { |k, v| "#{k}:#{v}" }.join(",") } : {}
end

Expand All @@ -260,5 +260,9 @@ def boost_fields_query
def licence_transaction_path?
finder_content_item.base_path == "/find-licences"
end

def force_ltr?
params["force-ltr"] == "true"
end
end
end

0 comments on commit 5fbef88

Please sign in to comment.