Correct. Simply install the library and edit search.jsp. You will need to edit the web.xml file in the WEB-INF dirctory to include the taglib.

<taglib>
  <taglib-uri>http://jsptags.com/tags/navigation/pager</taglib-uri>
  <taglib-location>/WEB-INF/jsp/pager-taglib.tld</taglib-location>
</taglib>



At 12:49 PM 1/12/2006, you wrote:

This is great,
What file do I need to edit?  Just the search.jsp or what.
andy

-----Original Message-----
From: Neal Whitley [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 12, 2006 12:34 PM
To: [email protected]
Subject: RE: Introduction to Nutch, Part 1: Crawling

Andy,

I am using this tag
library:  http://jsptags.com/tags/navigation/pager/index.jsp

You will have to hack the program a little and make sure to pass the
correct variables.  See basic example below:

Neal


<%-- PAGER OPTIONS --%>
<%
     String style = getParam(request, "style", "alltheweb");
     String position = getParam(request, "position", "top");
     String index = getParam(request, "index", "center");
     //int maxPageItems = getParam(request, "maxPageItems", 15);
     int maxPageItems = hitsPerPage;
     int maxIndexPages = getParam(request, "maxIndexPages", 9);

     int myCount = (int)hits.getTotal();  //big total max results this
changes a long value to an int value???
%>


Also: changed the startString from "start" variable to "pager.offset".

//  String startString = request.getParameter("start");
     String startString = request.getParameter("pager.offset");






<%-- START PAGINATION --%>


<%
//Check to see how far in the pagination you are.
if ((hits.totalIsExact() && end < hits.getTotal()) // more hits to show
     || (!hits.totalIsExact() && (hits.getLength() >
start+hitsPerPage)))
    {
%>




<%
//Reset some variables
String hitsPerPage2 = request.getParameter("hitsPerPage");
String hitsPerSite2 = request.getParameter("hitsPerSite");
%>


<pg:pager
     items="<%= myCount %>"
     index="<%= index %>"
     maxPageItems="<%= maxPageItems %>"
     maxIndexPages="<%= maxIndexPages %>"
     isOffset="<%= true %>"
     export="offset,currentPageNumber=pageNumber"
     url="http://www.yourdomain.com:8080/search.jsp";
     scope="request">

   <pg:param name="query" value="<%= queryString %>"/>
   <pg:param name="hitsPerPage" value="<%= hitsPerPage2 %>"/>
   <pg:param name="hitsPerSite" value="<%= hitsPerSite2 %>"/>
   <pg:param name="clustering" value="<%= clustering %>"/>



<%-- keep track of preference --%>
   <pg:param name="style"/>
   <pg:param name="position"/>
   <pg:param name="index"/>
   <pg:param name="maxPageItems"/>
   <pg:param name="maxIndexPages"/>



   <%-- save pager offset during form changes --%>



   <%-- warn if offset is not a multiple of maxPageItems --%>
   <% if (offset.intValue() % maxPageItems != 0 &&
          ("alltheweb".equals(style) || "lycos".equals(style)) )
      {
   %>
     <p>Warning: The current page offset is not a multiple of Max. Page
Items.
     <br>Please
     <pg:first><a href="<%= pageUrl %>">return to the first
page</a></pg:first>
     if any displayed range numbers appear incorrect.</p>
   <% } %>

   <%-- the pg:pager items attribute must be set to the total number of
        items for index before items to work properly --%>
   <% if ("top".equals(position) || "both".equals(position)) { %>
     <br>
     <pg:index>
       <% if ("texticon".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/texticon.jsp" flush="true"/>
       <% } else if ("jsptags".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/jsptags.jsp" flush="true"/>
       <% } else if ("google".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/google.jsp" flush="true"/>
       <% } else if ("altavista".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/altavista.jsp" flush="true"/>
       <% } else if ("lycos".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/lycos.jsp" flush="true"/>
       <% } else if ("yahoo".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/yahoo.jsp" flush="true"/>
       <% } else if ("alltheweb".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/alltheweb.jsp" flush="true"/>
       <% } else { %>
         <jsp:include page="/WEB-INF/jsp/simple.jsp" flush="true"/>
       <% } %>
     </pg:index>
   <% } %>


You can put content here or just place this code block at the bottom
of your page.



<% if ("bottom".equals(position) || "both".equals(position)) { %>
   <pg:index>
     <% if ("texticon".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/texticon.jsp" flush="true"/>
     <% } else if ("jsptags".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/jsptags.jsp" flush="true"/>
     <% } else if ("google".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/google.jsp" flush="true"/>
     <% } else if ("altavista".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/altavista.jsp" flush="true"/>
     <% } else if ("lycos".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/lycos.jsp" flush="true"/>
     <% } else if ("yahoo".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/yahoo.jsp" flush="true"/>
     <% } else if ("alltheweb".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/alltheweb.jsp" flush="true"/>
     <% } else { %>
         <jsp:include page="/WEB-INF/jsp/simple.jsp" flush="true"/>
     <% } %>
   </pg:index>
<% } %>
</pg:pager>


<%
     }
%>

<%-- END PAGINATION --%>










At 10:07 AM 1/12/2006, you wrote:

>How can we modify the results page.  I would like to have the pages
>listed instead of the "next page" button.
>
>Thanks,
>Andy



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Nutch-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-general

Reply via email to