Group By / Filters with UltraSphinx

Hi,

I use last version of UltraSphinx but filters dont work…

In my model :
is_indexed :fields => [‘content’, ‘titre’, ‘created_at’, {:field =>
‘lang’, :facet => true, :as => ‘lang’}],
:delta => true
or
is_indexed :fields => [‘content’, ‘titre’, ‘created_at’, ‘lang’],
:delta => true

In my controller :
@search = Ultrasphinx::Search.new(:query =>
get_query_by_subject(@subject.id),
:sort_mode => ‘descending’,
:sort_by => ‘created_at’,
:weights => {‘titre’ => 5.0,
‘content’ => 2.0},
:page => params[:page] || 1,
:filters => {“lang” => “fr”})

Result :
UsageError : field “lang” is invalid

:conditions => {“lang” => “fr”} doesnt work too.

I want to filter my results (lang, country, date, etc…) and group by
title. Ultrasphinx doc doesnt speak about that. Just query work ^^

And I dont really understand what are “facets”. Can you help me
please ?

Thank you,
Florian

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs