Package org.archive.wayback.core

Examples of org.archive.wayback.core.UrlSearchResults


      }
     

    } else if (searchType.equals(WaybackConstants.REQUEST_URL_PREFIX_QUERY)) {

      results = new UrlSearchResults();
      // build up the FilterChain(s):
      ObjectFilterChain<SearchResult> filters =
        new ObjectFilterChain<SearchResult>();
      filters.addFilter(guardrail);
      filters.addFilter(new DuplicateRecordFilter());
View Full Code Here


    NodeList filters = getRequestFilters(document);
    String resultsType = getResultsType(document);
    if(resultsType.equals(WaybackConstants.RESULTS_TYPE_CAPTURE)) {
      results = new CaptureSearchResults();
    } else {
      results = new UrlSearchResults();
    }
    for(int i = 0; i < filters.getLength(); i++) {
      String key = filters.item(i).getNodeName();
      String value = filters.item(i).getTextContent();
      if(!key.equals("#text")) {
View Full Code Here

   
    if (markPrefixQueries) {
      urlKey += "*\t";
    }

    UrlSearchResults results = new UrlSearchResults();

    // the various CAPTURE filters to apply to the results:
    ObjectFilterChain<CaptureSearchResult> cFilters =
      new ObjectFilterChain<CaptureSearchResult>();

   
    // Groupings of filters for clarity(?) and summary annotation of
    // results:
    List<CaptureFilterGroup> groups = getRequestFilterGroups(wbRequest);
    for(CaptureFilterGroup cfg : groups) {
      cFilters.addFilters(cfg.getFilters());
    }
    if (filter != null) {
      cFilters.addFilter(filter);
    }
   

    // we've filtered the appropriate CaptureResult objects within the
    // iterator, now we're going to convert whatever records make it past
    // the filters into UrlSearchResults, and then do further window
    // filtering on those results:
    // Windows:
    // the window URL filters to apply to the results, once they're
    // UrlSearchResult objects
    ObjectFilterChain<UrlSearchResult> uFilters =
      new ObjectFilterChain<UrlSearchResult>();
    WindowFilterGroup<UrlSearchResult> window =
      new WindowFilterGroup<UrlSearchResult>(wbRequest,this);
    uFilters.addFilters(window.getFilters());

    CloseableIterator<CaptureSearchResult> itrC = null;
    CloseableIterator<UrlSearchResult> itrU = null;
   
    try {
      PerfStats.timeStart(PerfStat.IndexLoad);
     
      itrC = new ObjectFilterIterator<CaptureSearchResult>(
          source.getPrefixIterator(urlKey),cFilters)
   
      itrU = new ObjectFilterIterator<UrlSearchResult>(
            new CaptureToUrlSearchResultIterator(itrC),
            uFilters);
   
      while(itrU.hasNext()) {
        results.addSearchResult(itrU.next());
      }
    } finally {
      if (itrU != null) {
        cleanupIterator(itrU);
      }
View Full Code Here

    }
    return results;
  }
  private UrlSearchResults documentToUrlSearchResults(
      Document document) {
    UrlSearchResults results = new UrlSearchResults();
    NodeList xresults = getSearchResults(document);
    for(int i = 0; i < xresults.getLength(); i++) {
      Node xresult = xresults.item(i);
      UrlSearchResult result = searchElementToUrlSearchResult(xresult);
      results.addSearchResult(result, true);
    }
    return results;
  }
View Full Code Here

    public void testHandleRequest_UrlSearchResults() throws Exception {
        setUrlQueryRequest(wbRequest, "http://www.example.com/", "20100601123456");

        // AccessPoint is not concerned of the details of UrlSearchResults. it just
        // forwards the request to QueryRenderer. so we leave it uninitialized here.
        UrlSearchResults results = new UrlSearchResults();
        EasyMock.expect(resourceIndex.query(wbRequest)).andReturn(results);
       
        // EXPECTATION: AccessPoint.handleQuery() calls query.renderUrlResults().
        query.renderUrlResults(httpRequest, httpResponse, wbRequest, results, cut.getUriConverter());
       
View Full Code Here

  UrlSearchResults results;
  int count;
 
  @Override
    public void begin() {
    results = new UrlSearchResults();
      count = 0;
    }
View Full Code Here

     
      getQuery().renderCaptureResults(httpRequest,httpResponse,wbRequest,
            cResults,getUriConverter());

    } else if(results instanceof UrlSearchResults) {
      UrlSearchResults uResults = (UrlSearchResults) results;
      getQuery().renderUrlResults(httpRequest,httpResponse,wbRequest,
          uResults,getUriConverter());
    } else {
      throw new WaybackException("Unknown index format");
    }
View Full Code Here

TOP

Related Classes of org.archive.wayback.core.UrlSearchResults

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.