From 2447bb12dd82afe91141ab286f628be1a30f642d Mon Sep 17 00:00:00 2001 From: "Andrew N. Shalaev" Date: Fri, 28 Jun 2019 14:44:32 +0500 Subject: [PATCH] fix: dont override ts_args in fast_facet --- lib/sphinx/integration/fast_facet.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/sphinx/integration/fast_facet.rb b/lib/sphinx/integration/fast_facet.rb index a37bc43..a13fa5b 100644 --- a/lib/sphinx/integration/fast_facet.rb +++ b/lib/sphinx/integration/fast_facet.rb @@ -1,15 +1,15 @@ -# coding: utf-8 module Sphinx::Integration::FastFacet extend ActiveSupport::Concern module ClassMethods - def fast_facet_ts_args(facet, ts_args = {}) - ts_args.merge(:group => facet, - :limit => ts_args[:limit] || max_matches, - :page => 1, - :rank_mode => :none, - :match_mode => ThinkingSphinx::DEFAULT_MATCH) + { + group: facet, + limit: max_matches, + page: 1, + rank_mode: :none, + match_mode: ThinkingSphinx::DEFAULT_MATCH + }.merge(ts_args) end def fast_facet_compute_result(sph_data, ts_args = {}) @@ -37,6 +37,5 @@ def fast_facet(query, facet, ts_args = {}) ts_result = self.search_for_ids(query, new_ts_args) fast_facet_compute_result(ts_result, new_ts_args) end - end -end \ No newline at end of file +end