thinking-sphinx icon indicating copy to clipboard operation
thinking-sphinx copied to clipboard

Search Count with Scope fails

Open hotsen opened this issue 16 years ago • 1 comments

Hi,

maybe this a bug or do I miss something?

I have a scope like this:

define_index do index title has categories(:id), :as => :category_ids end

sphinx_scope(:with_category) { |category_id| { :with => { :category_ids => category_id }} }

Normally, when I count search results for a category with keyword, I would do:

Video.search_count 'xxx', :with => { :category_ids => 1 } # => 0

which is korrekt. When I do the same with the scope, I get the wrong result:

Video.with_category(1).search_count 'xxx' # => 7

7 is the actual number of video in Category 1, so it doesn't take the keyword into account anymore ...

Any Ideas?

Regards

hotsen avatar Aug 20 '10 13:08 hotsen

Just fixed this - grab the latest gem or reinstall the plugin, and should be fine. Thanks for pointing out this bug!

pat avatar Aug 23 '10 10:08 pat