Just one more question

ThinkingSphinx::Index.define :tour, :with => :active_record do
   #fields
   indexes summary
   indexes country, direction, sortable: true
   indexes :name, sortable: true
   # attributes 
   has cost 
end 
------------------------------------------------------------------------------------
@tours = Tour.search("#{params[:query]} #{params[:name]} 
                                 #{params[:direction]} #{params[:country]}", 
                                 :with => {:cost => params[:cost_from].
.params[:cost_to]}, 
                                 :match_mode => :any)

Now cost field became obligatory, if I left it blank when searching, such 
error occurs:  sphinxql: syntax error, unexpected AND, expecting CONST_INT 
or CONST_FLOAT or '-' near 'AND  AND sphinx_deleted = 0 LIMIT 0, 20; SHOW 
META'

-- 
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/groups/opt_out.

Reply via email to