Removed Sunspot Mongo from weblinks

This commit is contained in:
saurabhbhatia 2013-12-20 22:41:33 +08:00
parent c36d730bd3
commit 9b10703283
5 changed files with 18 additions and 10 deletions

View File

@ -9,15 +9,22 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
end
def search_result
debug
if params[:search_query] == ""
@bulletins = get_bulletins_for_index
else
@search = Bulletin.tire.search "#{params[:search_query]}"
search_result = @search.collect{|result| result.id}
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
end
end
def search
if params[:search_query] == ""
@bulletins = get_bulletins_for_index
else
# @search = Bulletin.solr_search do
# fulltext params[:search_query]
# with(:frontend_search,true)
# with(:available_lang).any_of([I18n.locale.to_s])
# end
# @bulletins = Bulletin.where(:category_id.in => params[:category_id]).and(:is_rejected=>false).and(:is_pending=>false)
@search = Bulletin.tire.search "#{params[:search_query]}"
search_result = @search.collect{|result| result.id}

View File

@ -1,5 +1,5 @@
<p>Test</p>
<% # encoding: utf-8 %>
<%= flash_messages %>
<h1 class="h1"><%= @page.title rescue nil %></h1>

View File

@ -1,5 +1,5 @@
<p>Search</p>
<%= form_tag panel_announcement_front_end_search_result_path, method: :get do %>
<%= form_tag panel_announcement_front_end_search_path, method: :get do %>
<%= hidden_field_tag :category_id, params[:category_id] %>
<%= hidden_field_tag :tag_id, params[:tag_id] %>
<p>

View File

@ -28,6 +28,8 @@ Rails.application.routes.draw do
namespace :front_end do
match "index_by_unit" => "bulletins#index_bulletins_by_unit",:as => :index_bulletins_by_unit
match "search_result" => "bulletins#search_result"
match "search" => "bulletins#search"
resources :bulletins # do
# match "preview" => "bulletins#preview_content",:as => :get_preview_content
# end

View File

@ -3,7 +3,6 @@ class WebLink
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include Sunspot::Mongoid2
include OrbitCategory::Categorizable
include OrbitModel::LanguageRestrict