Package org.apache.nutch.webapp.common

Examples of org.apache.nutch.webapp.common.SearchResultBean


   */
  public List getDocs(){
    int maxNumDocs=Math.min(numDocs,cluster.getHits().length);
    List docs=new ArrayList(maxNumDocs);
    for(int i=0;i<maxNumDocs;i++){
      docs.add(new SearchResultBean(null, null, cluster.getHits()[i],null));
    }
    return docs;
  }
View Full Code Here


  public void nutchPerform(ComponentContext tileContext,
      HttpServletRequest request, HttpServletResponse response,
      ServletContext servletContext) throws ServletException, IOException {

    SearchResultBean hit = (SearchResultBean) request.getAttribute("hit");

    if (hit != null) {

      // Content-Type
      String primaryType = hit.getDetails().getValue("primaryType");
      String subType = hit.getDetails().getValue("subType");

      String contentType = subType;
      if (contentType == null)
        contentType = primaryType;
      if (contentType != null) {
        request.setAttribute("contentType", contentType);
      }
      // Content-Length
      String contentLength = hit.getDetails().getValue("contentLength");
      if (contentLength != null) {
        request.setAttribute("contentLength", contentLength);
      }

      // Last-Modified
      String lastModified = hit.getDetails().getValue("lastModified");
      if (lastModified != null) {
        long millis = new Long(lastModified).longValue();
        Date date = new Date(millis);
        request.setAttribute("lastModified", date);
      }
View Full Code Here

TOP

Related Classes of org.apache.nutch.webapp.common.SearchResultBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.