karmi/tire — Issue #207: Wrong facets count
Author: niuage
Created: 2012-01-18 00:40:25+00:00
State: open

I feel bad opening an issue for something that seem simple and documented, but I can't figure it out:

I'm trying to do a simple facet like in the doc: http://karmi.github.com/tire/#section-Faceted_Search

Event.search do
query { string q[:keywords] } if q[:keywords].present?
filter :range, from: { gte: Time.zone.now }
facet("timeline") do
date :from, interval: 'month'
end
end

The timeline facet does not seem to depend on my query and filter, the counts are for the whole index. (ex: I have 2 results, but 3 facet entries, with counts like 28, 23 etc...)

What's wrong?

Thanks.