    # File lib/plugins/storage/status.rb, line 14
        def self.search(query)
          raise "query must be Hash(#{query}, #{query.class})" unless query.kind_of? Hash
          if query[:text] == nil then
            query[:text] = '';
          end
          if query[:user] == nil then
            query[:user] = '';
          end
          result = []
          sql = "select created_at, screen_name, post_text, in_reply_to_status_id, post_id, user_id "
          sql += "from post inner join user on post.user_id = user.id where post_text like '%' || ? || '%'"
          DB.instance.db.execute(sql,
                                 query[:text]) do |created_at, screen_name, post_text, in_reply_to_status_id, post_id, user_id|
            created_at = Time.at(created_at).to_s
            post_text.force_encoding('UTF-8') if post_text.respond_to?(:force_encoding)
            result << {
              :id => post_id,
              :created_at => created_at,
              :text => post_text,
              :in_reply_to_status_id => in_reply_to_status_id,
              :in_reply_to_user_id => nil,
              :user => {
                :id => user_id,
                :screen_name => screen_name
              }
            }
          end
          Rubytter.structize(result)
        end