Index: conf/nutch-default.xml
===================================================================
--- conf/nutch-default.xml	(revision 627887)
+++ conf/nutch-default.xml	(working copy)
@@ -811,6 +811,17 @@
   </description>
 </property>
 
+<property>
+  <name>searcher.max.hits.per.page</name>
+  <value>1000</value>
+  <description> The maximum number of hits to show per page. -1 if
+    unlimited. If the number of hits requested by the user (via
+    hitsPerPage parameter in the query string) is more than the value
+    specified in this property, then this value is assumed as the number
+    of hits per page.
+  </description>
+</property>
+
 <!-- URL normalizer properties -->
 
 <property>
Index: src/java/org/apache/nutch/searcher/OpenSearchServlet.java
===================================================================
--- src/java/org/apache/nutch/searcher/OpenSearchServlet.java	(revision 627887)
+++ src/java/org/apache/nutch/searcher/OpenSearchServlet.java	(working copy)
@@ -45,6 +45,7 @@
  * Nutch-specific extensions. */   
 public class OpenSearchServlet extends HttpServlet {
   private static final Map NS_MAP = new HashMap();
+  private int MAX_HITS_PER_PAGE;
 
   static {
     NS_MAP.put("opensearch", "http://a9.com/-/spec/opensearchrss/1.0/");
@@ -67,6 +68,7 @@
     } catch (IOException e) {
       throw new ServletException(e);
     }
+    MAX_HITS_PER_PAGE = conf.getInt("searcher.max.hits.per.page", -1);
   }
 
   public void doGet(HttpServletRequest request, HttpServletResponse response)
@@ -95,6 +97,8 @@
     String hitsString = request.getParameter("hitsPerPage");
     if (hitsString != null)
       hitsPerPage = Integer.parseInt(hitsString);
+    if(MAX_HITS_PER_PAGE > 0 && hitsPerPage > MAX_HITS_PER_PAGE)
+      hitsPerPage = MAX_HITS_PER_PAGE;
 
     String sort = request.getParameter("sort");
     boolean reverse =
Index: src/web/jsp/search.jsp
===================================================================
--- src/web/jsp/search.jsp	(revision 627887)
+++ src/web/jsp/search.jsp	(working copy)
@@ -40,6 +40,11 @@
   private int HITS_TO_CLUSTER;
 
   /**
+   * Maximum hits per page to be displayed.
+   */
+  private int MAX_HITS_PER_PAGE;
+
+  /**
    * An instance of the clustering extension, if available.
    */
   private OnlineClusterer clusterer;
@@ -57,9 +62,9 @@
     
     final ServletContext application = getServletContext(); 
     nutchConf = NutchConfiguration.get(application);
+	  HITS_TO_CLUSTER = nutchConf.getInt("extension.clustering.hits-to-cluster", 100);
+    MAX_HITS_PER_PAGE = nutchConf.getInt("searcher.max.hits.per.page", -1);
 
-	HITS_TO_CLUSTER = nutchConf.getInt("extension.clustering.hits-to-cluster", 100);
-
     try {
       clusterer = new OnlineClustererFactory(nutchConf).getOnlineClusterer();
     } catch (PluginRuntimeException e) {
@@ -105,6 +110,8 @@
   String hitsString = request.getParameter("hitsPerPage");
   if (hitsString != null)
     hitsPerPage = Integer.parseInt(hitsString);
+  if(MAX_HITS_PER_PAGE > 0 && hitsPerPage > MAX_HITS_PER_PAGE)
+    hitsPerPage = MAX_HITS_PER_PAGE;
 
   int hitsPerSite = 2;                            // max hits per site
   String hitsPerSiteString = request.getParameter("hitsPerSite");

