Package org.jayasoft.woj.common.model.search

Examples of org.jayasoft.woj.common.model.search.SearchResult


      }
      request.setAttribute("start", new Integer(startIndex));
     
      SearchService s = WOJServer.getInstance().getSearchService();

      SearchResult r;
      try {
        r = s.search(q, SecurityHelper.getUAK(request), startIndex);
      } catch (ParseException e) {
        throw new IllegalArgumentException("bad query: "+q);
      }
     
            request.setAttribute("processed", Boolean.TRUE);
            request.setAttribute("query", q);
            request.setAttribute("hitsCount", new Long(r.getHitsCount()));
            request.setAttribute("queryProcessTime", new Long(r.getQueryProcessTime()));
           
            request.setAttribute("nextResults", r.getNextResults());
            request.setAttribute("prevResults", r.getPreviousResults());
           
            request.setAttribute("hits", r.getHits());

            request.setAttribute("processTime", new Long(r.getProcessTime()));
           
            d.forward(request, response);

  }
View Full Code Here


        String query = CommandUtil.getStringFromParamKey(m, Commands.SEARCH.P_QUERY);
        Integer startIndex = CommandUtil.getIntegerFromParamKey(m, Commands.SEARCH.P_START_INDEX);
       
    SearchService s = WOJServer.getInstance().getSearchService();

    SearchResult r;
    try {
      r = s.search(query, uak, startIndex == null?1:startIndex.intValue());
    } catch (ParseException e) {
      throw new IllegalArgumentException("bad query: "+query);
    }
View Full Code Here

        is.close();

        long end  = System.currentTimeMillis();
        long processTime = end - start;

        return new SearchResult(results, hitsCount, previousResults, nextResults, processTime, queryProcessTime);

  }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.common.model.search.SearchResult

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.