thinking-sphinx
thinking-sphinx copied to clipboard
Search Count with Scope fails
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
Just fixed this - grab the latest gem or reinstall the plugin, and should be fine. Thanks for pointing out this bug!