myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2177] trunk/lib/rest.rb: added num option to /se


From: noreply
Subject: [myexperiment-hackers] [2177] trunk/lib/rest.rb: added num option to /search.xml
Date: Mon, 27 Apr 2009 09:28:37 -0400 (EDT)

Revision
2177
Author
dgc
Date
2009-04-27 09:28:37 -0400 (Mon, 27 Apr 2009)

Log Message

added num option to /search.xml

Modified Paths

Diff

Modified: trunk/lib/rest.rb (2176 => 2177)


--- trunk/lib/rest.rb	2009-04-24 14:32:02 UTC (rev 2176)
+++ trunk/lib/rest.rb	2009-04-27 13:28:37 UTC (rev 2177)
@@ -866,8 +866,17 @@
 
   results = []
 
+  num = 25
+
+  if query['num']
+    num = query['num'].to_i
+  end
+
+  num = 25  if num < 0
+  num = 100 if num > 100
+
   if Conf.solr_enable and not search_query.nil? and search_query != ""
-    results = models[0].multi_solr_search(search_query, :limit => 100,
+    results = models[0].multi_solr_search(search_query, :limit => num,
         :models => models).results
   end
 

reply via email to

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