Skip to content

Commit

Permalink
Turn off search for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
bamnet committed Jan 15, 2012
1 parent f62cf29 commit 25b8ac6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/controllers/documents_controller.rb
Expand Up @@ -43,7 +43,7 @@ def create

respond_to do |format|
if @document.save
@document.revisions.current.first.delay.update_search_text unless @document.revisions.empty?
#@document.revisions.current.first.delay.update_search_text unless @document.revisions.empty?
format.html { redirect_to(@document, :notice => 'Document was successfully created.') }
format.xml { render :xml => @document, :status => :created, :location => @document }
else
Expand All @@ -60,7 +60,7 @@ def update

respond_to do |format|
if @document.update_attributes(params[:document])
@document.revisions.current.first.delay.update_search_text unless @document.revisions.empty?
#@document.revisions.current.first.delay.update_search_text unless @document.revisions.empty?
format.html { redirect_to(@document, :notice => 'Document was successfully updated.') }
format.xml { head :ok }
else
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/revisions_controller.rb
Expand Up @@ -21,7 +21,7 @@ def create

respond_to do |format|
if @revision.save
@revision.delay.update_search_text
#@revision.delay.update_search_text
format.html { redirect_to(@revision.document, :notice => 'Revision was successfully created.') }
format.xml { render :xml => @revision, :status => :created, :location => @revision }
else
Expand Down
8 changes: 4 additions & 4 deletions app/models/category.rb
Expand Up @@ -8,10 +8,10 @@ class Category < ActiveRecord::Base
# Let us quickly find the root categories
scope :roots, where(:parent_id => nil)

searchable do
text :name
text :description
end
#searchable do
# text :name
# text :description
#end


# Test if this category is a root or not
Expand Down
14 changes: 7 additions & 7 deletions app/models/document.rb
Expand Up @@ -5,13 +5,13 @@ class Document < ActiveRecord::Base

accepts_nested_attributes_for :revisions

searchable do
text :title, :default_boost => 2, :stored => true
text :description, :stored => true
text :search_texts, :stored => true do
revisions.map { |revision| revision.search_text }
end
end
#searchable do
# text :title, :default_boost => 2, :stored => true
# text :description, :stored => true
# text :search_texts, :stored => true do
# revisions.map { |revision| revision.search_text }
# end
#end

def download_count
revisions.sum(:download_count)
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_topbar_left.html.erb
Expand Up @@ -2,7 +2,7 @@
<div id="search">
<%= form_tag(search_documents_path, :method => 'post') do %>
<%= search_field_tag 'query', '', :results=>5, :placeholder => "Type here to search docs and categories", :size=>50 %>
<%= submit_tag "Search" %>
<%#= submit_tag "Search" %>
<% end %>
</div>
</div>

0 comments on commit 25b8ac6

Please sign in to comment.