Is there any reason for a search page that searches through events for a keyword and then displays those that contain the keyword to not give any results in production when it does in development? I''ve made sure I''m searching terms that should give me results in production, but it''s like it''s not searching through the events at all or something. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Amanda .. wrote:> Is there any reason for a search page that searches through events for a > keyword and then displays those that contain the keyword to not give any > results in production when it does in development? I''ve made sure I''m > searching terms that should give me results in production, but it''s like > it''s not searching through the events at all or something.Check or turn on your logging in Production to see what''s going on. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ar Chron wrote:> Check or turn on your logging in Production to see what''s going on.In my dev log I get a whole bunch of stuff from checkin each event for the keywords (i think thats what its doin): Processing SearchController#keyword (for 127.0.0.1 at 2008-06-03 16:29:17) [POST] Session ID: bc95e3751aa213c624c33af71a846c8c Parameters: {"commit"=>"Search", "text"=>"test", "order"=>"created_on", "action"=>"keyword", "method"=>"post", "controller"=>"search", "search_auds"=>"1", "search_streams"=>"1"} [4;36;1mCalendar Load (0.001025) [0m [0;1mSELECT * FROM calendars WHERE (hidden=0) [0m [4;35;1mCalendar Columns (0.002512) [0m [0mSHOW FIELDS FROM calendars [0m [4;36;1mCalendar Load (0.001113) [0m [0;1mSELECT * FROM calendars WHERE (hidden=0) [0m [4;35;1mStream Columns (0.002510) [0m [0mSHOW FIELDS FROM calendars [0m [4;36;1mEvent Columns (0.002639) [0m [0;1mSHOW FIELDS FROM events [0m [4;35;1mStamp Columns (0.001862) [0m [0mSHOW FIELDS FROM stamps [0m .... In the production log I just get: Processing SearchController#keyword [POST] Session ID: a0db357e9a9aaec2298535c55618f688 Parameters: {"commit"=>"Search", "text"=>"test", "order"=>"created_on", "action"=>"keyword", "method"=>"post", "controller"=>"search", "search_auds"=>"1", "search_streams"=>"1"} Rendering within layouts/application Rendering search/keyword Completed in 0.15170 So it doesn''t even check for the keywords in the events? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I believe you need to turn on debug for your production environment to see more. Something like this in your production.rb should give you most of "production" behaviors, but you''ll still get debug. # Show full error reports and enable caching config.log_level = :debug config.action_controller.consider_all_requests_local = true config.action_controller.perform_caching = true config.action_view.cache_template_extensions = true config.action_view.debug_rjs = true I always add config.active_record.colorize_logging = false to get rid of the unreadable [4;35;1mS stuff -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ar Chron wrote:> I believe you need to turn on debug for your production environment to > see more. >Where do I do this? In the terminal? sorry I''m new to the rails stuff -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You do this in your environment configuration file, in this case config/environments/production.conf Serge On Jun 3, 5:45 pm, "Amanda .." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Ar Chron wrote: > > I believe you need to turn on debug for your production environment to > > see more. > > Where do I do this? In the terminal? sorry I''m new to the rails stuff > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks a lot for that, now I can see that it is finding some events...but only past events (dated before today), and not displaying them (this is what it''s supposed to do)...but it should also be finding events for today and the future and displaying them. I think there might be something wrong in the base condition in the event search method: def self.search(search_streams, search_auds, keywords, options = {}, *args) default_options = { "calendars" => Calendar.find_public, :status => :approved } options = default_options.merge(options) if keywords.nil? or keywords == "" t = "%" + keywords.to_s.gsub(/\s/, ''%'') + "%" base_condition = ["(title like ? OR body like ? OR location like ?)", t, t, t] else t = (keywords.split(" ").collect { |x| "[[:<:]]" + x + "[[:>:]]" }).join("|") base_condition = ["(title regexp ? OR body regexp ? OR location regexp ?)", t, t, t] end events = [] streams = [] audiences = [] options["calendars"].each do |c| audiences << c if c.is_a?(Audience) streams << c if c.is_a?(Stream) end if search_streams == "1" for cal in streams base_condition[0] += '' AND stamps.calendar_id = ? AND stamps.status = ?'' base_condition += [cal.id, Stamp::STATUS[options[:status]]] e = Event.find(:all, :conditions => base_condition, :include => :stamps) events += e end end if search_auds == "1" for cal in audiences base_condition[0] += " AND audiences_events.audience_id = ?" base_condition << cal.id # explicitly written joins instead of using the :include option # the :include option creates an invalid SQL statement e = Event.find(:all, :conditions => base_condition, :include => :stamps, :joins => ''LEFT OUTER JOIN audiences_events ON audiences_events.event_id = events.id LEFT OUTER JOIN calendars ON calendars.id = audiences_events.audience_id'') events += e end end events.uniq! Do you see anything there that would work properly in development but not in production? Thanks a lot for your help! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Does anyone have any suggestions? I''m completely stuck on this and my logs aren''t showing me anything that would help. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Okay so I figured out that if i comment out the 2 lines: base_condition[0] +='' AND stamps.calendar_id = ? AND stamps.status = ?'' base_condition += [cal.id, Stamp::STATUS[options[:status]]] Then the search finds and displays the events like it should...anyone know why this is? I don''t get it -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---