myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3311] trunk/app: Search results now ranked by re


From: noreply
Subject: [myexperiment-hackers] [3311] trunk/app: Search results now ranked by relevance to query
Date: Wed, 16 Jan 2013 14:48:43 +0000 (UTC)

Revision
3311
Author
fbacall
Date
2013-01-16 14:48:42 +0000 (Wed, 16 Jan 2013)

Log Message

Search results now ranked by relevance to query

Modified Paths

Diff

Modified: trunk/app/controllers/search_controller.rb (3310 => 3311)


--- trunk/app/controllers/search_controller.rb	2013-01-15 16:22:06 UTC (rev 3310)
+++ trunk/app/controllers/search_controller.rb	2013-01-16 14:48:42 UTC (rev 3311)
@@ -189,10 +189,12 @@
   def search_all
 
     @query = params[:query]
+    pivot_options = Conf.pivot_options.dup
+    pivot_options["order"] = [{"order" => "id ASC", "option" => "relevance", "label" => "Relevance"}] + pivot_options["order"]
 
     @pivot, problem = calculate_pivot(
 
-        :pivot_options    => Conf.pivot_options,
+        :pivot_options    => pivot_options,
         :params           => params,
         :user             => current_user,
         :search_models    => [Workflow, Blob, Pack, User, Network, Service],

Modified: trunk/app/models/blob.rb (3310 => 3311)


--- trunk/app/models/blob.rb	2013-01-15 16:22:06 UTC (rev 3310)
+++ trunk/app/models/blob.rb	2013-01-16 14:48:42 UTC (rev 3311)
@@ -33,7 +33,6 @@
     :mutable => [ :title, :body, :body_html ]
 
   acts_as_solr(:fields => [:title, :local_name, :body, :kind, :contributor_name, :tag_list],
-               :boost => "rank",
                :include => [ :comments ]) if Conf.solr_enable
 
   belongs_to :content_blob, :dependent => :destroy

Modified: trunk/app/models/pack.rb (3310 => 3311)


--- trunk/app/models/pack.rb	2013-01-15 16:22:06 UTC (rev 3310)
+++ trunk/app/models/pack.rb	2013-01-16 14:48:42 UTC (rev 3311)
@@ -38,7 +38,6 @@
   format_attribute :description
   
   acts_as_solr(:fields => [ :title, :description, :contributor_name, :tag_list ],
-               :boost => "rank",
                :include => [ :comments ]) if Conf.solr_enable
   
   has_many :contributable_entries,

Modified: trunk/app/models/workflow.rb (3310 => 3311)


--- trunk/app/models/workflow.rb	2013-01-15 16:22:06 UTC (rev 3310)
+++ trunk/app/models/workflow.rb	2013-01-16 14:48:42 UTC (rev 3311)
@@ -60,7 +60,6 @@
                   :file_ext, :last_edited_by, :content_type_id, :image, :svg ]
 
   acts_as_solr(:fields => [ :title, :body, :filename, :tag_list, :contributor_name, :kind, :get_all_search_terms ],
-               :boost => "rank",
                :include => [ :comments ]) if Conf.solr_enable
 
   acts_as_runnable

reply via email to

[Prev in Thread] Current Thread [Next in Thread]