Hi Chaitali `group_by` in an index definition is only for SQL-backed indices (:with => :active_record), as it’s for the generated SQL query (whereas real-time indices operate on ActiveRecord instances rather than SQL queries). So, you’ll want to remove that from your index definition, and then run a `rebuild` and see if that helps?
Kind regards, — Pat > On 11 Sep 2015, at 5:21 am, Chaitali Khangar <[email protected]> > wrote: > > Hi, > > I have tried group_by in real time but it's giving error. Can you please help > me? > > User Index > > has created_month_year,:type=>:integer > > As mention in some search result I have tried group_by in user index: > > User Index with group by > > has created_month_year,:type=>:integer > group_by created_month_year > > Thinking Sphinx Query > > Tried below queries > User.search(:group_by=>"created_month_year") > User.search(:group_by=>:created_month_year) > > Actual Output > > Error: index user_core: parse error: unknown identifier 'groupby' > > Expected Output > Its not grouping the result according to created_month_year > > > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/thinking-sphinx > <http://groups.google.com/group/thinking-sphinx>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/thinking-sphinx. For more options, visit https://groups.google.com/d/optout.
