karmi/tire — Issue #225: Search facet requires using a defined type 
Author: agnellvj
Created: 2012-02-02 21:31:15+00:00
State: open

So the problem is I need to do a ```Statistical``` facet but right now there isn't one defined.

I took a peek at the ```Facet``` class and I think this could work as a workaround by initializing ```@value = {}```. This would allow the following to work:

s = Tire.search 'my_index' do
query do
string 'title:T*'
end
facet 'my_stats', { :statistical => { :field => 'field_name' } }
end

The other option is to implement ```Facet#statistical```. I took a peek at the way to do it and it doesn't seem like it is straightforward because you can either use the ```field``` option or ```script``` option with params.

Not sure what the best way to go. Thoughts?