Facets and Query

5 views
Skip to first unread message

Christophe Moins

unread,
Nov 15, 2012, 10:25:09 AM11/15/12
to elasti...@googlegroups.com
Hi,

I'm doing a query, and I want to get facets too.
But I don't know how to get facets list, I'm trying to user res['facets'] but I get an error :

irb(main):116:0> res['facets']
NoMethodError: undefined method `raise' for #<Elastictastic::Scope:0x007fa9bb51fdf8>
from /Users/MrMoins/.rbenv/versions/1.9.3-p286/gemsets/elasticsearch/gems/elastictastic-0.10.4/lib/elastictastic/scope.rb:229:in `method_missing'
from /Users/MrMoins/.rbenv/versions/1.9.3-p286/gemsets/elasticsearch/gems/elastictastic-0.10.4/lib/elastictastic/scope.rb:123:in `[]'
from (irb):116
from /Users/MrMoins/.rbenv/versions/1.9.3-p286/gemsets/elasticsearch/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /Users/MrMoins/.rbenv/versions/1.9.3-p286/gemsets/elasticsearch/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /Users/MrMoins/.rbenv/versions/1.9.3-p286/gemsets/elasticsearch/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'


Matthew A. Brown

unread,
Nov 15, 2012, 11:22:18 AM11/15/12
to elasti...@googlegroups.com
Hi Christophe,

Use the #all_facets method (#facets is shadowed by the query DSL).

Mat




--
 
 

Reply all
Reply to author
Forward
0 new messages