ThinkingSphinx::Index.define 'refinery/wayfinders/project', :with => :active_record do
indexes :name, sortable: true
indexes :city
indexes :description
indexes courses.name, as: :course_name
indexes courses.is_visible, as: :is_visible <------------------------ This one?
set_property :group_concat_max_len => 8192
has zip, external_id
has courses.is_visible, as: :is_visible, type: :boolean <------------------- Or this one?
end
@project_search = Refinery::Wayfinders::Project.search(params[:search], :with => { :is_visible => true })
@project_search = Refinery::Wayfinders::Project.search(params[:search], :include => :is_visible, :conditions => { :is_visible => true })
--
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 thinking-sphi...@googlegroups.com.
To post to this group, send email to thinkin...@googlegroups.com.
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.
Hi Pat
Projects with only visible courses is what I need.
If I do:
has courses.is_visible, as: :is_visible
Then I'm getting an error about it expects a uint, bigint or something else.
Regards
You received this message because you are subscribed to a topic in the Google Groups "Thinking Sphinx" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/thinking-sphinx/IoYl27QsSVI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to thinking-sphi...@googlegroups.com.
ThinkingSphinx::Index.define 'refinery/wayfinders/project', :with => :active_record do
indexes :name, sortable: true
indexes :city
indexes :description
indexes courses.name, as: :course_name
set_property :group_concat_max_len => 8192
has zip, external_id
has courses.is_visible, as: :is_visible <---------------------
end
@project_search = Refinery::Wayfinders::Project.search(params[:search], without: { is_visible: false } )
ERROR: source 'refinery_wayfinders_project_core_0': expected attr type ('uint' or 'timestamp' or 'bigint') in sql_attr_multi, got 'bool is_visible from field'.
ERROR: index 'refinery_wayfinders_project_core': failed to configure some of the sources, will not index.
Sphinx Query (0.8ms) SELECT * FROM `refinery_wayfinders_project_core` WHERE MATCH('felttest') AND `is_visible` = 1 AND `sphinx_deleted` = 0 LIMIT 0, 20
has "IF(SUM(refinery_wayfinders_courses.is_visible) = COUNT(refinery_wayfinders_courses.is_visible), 1, 0)", as: :is_visible, type: :boolean