Package org.archive.wayback.core

Examples of org.archive.wayback.core.SearchResults


      RangeMember best = findBestMember();
      if(best == null) {
        throw new ResourceIndexNotAvailableException("Unable to find active range for request.");
      }
      best.noteConnectionStart();
      SearchResults results;
      try {

        results = best.query(wbRequest);
        best.noteConnectionSuccess();
        return results;
View Full Code Here


    FieldSplitFormat fmt = CDXFieldConstants.CDX_ALL_NAMES;
    testCDXServer.cdxLines = new CDXLine[] {
        new CDXLine(CDXLINE1, fmt)
    };
   
    SearchResults sr = cut.query(wbr);
   
    assertEquals(1,  sr.getReturnedCount());
   
    assertEquals(1, testCDXServer.capturedArgs.size());
   
    Object[] args = testCDXServer.capturedArgs.get(0);
    CDXQuery query = (CDXQuery)args[0];
View Full Code Here

    };

   
    cut.setBaseStatusRegexp("");
    {
      SearchResults sr = cut.query(wbr);

      assertEquals(1, testCDXServer.capturedArgs.size());

      Object[] args = testCDXServer.capturedArgs.get(0);
      CDXQuery query = (CDXQuery)args[0];
      String[] filter = query.getFilter();
      assertNull("there should be no filter", filter);
    }
   
    testCDXServer.clearCapturedArgs();
    cut.setBaseStatusRegexp("!500");
    {
      SearchResults sr = cut.query(wbr);

      assertEquals(1, testCDXServer.capturedArgs.size());
     
      Object[] args = testCDXServer.capturedArgs.get(0);
      CDXQuery query = (CDXQuery)args[0];
View Full Code Here

    FieldSplitFormat fmt = CDXFieldConstants.CDX_ALL_NAMES;
    testCDXServer.cdxLines = new CDXLine[] {
        new CDXLine(CDXLINE2, fmt)
    };
   
    SearchResults sr = cut.query(wbr);
   
    assertEquals(1, testCDXServer.capturedArgs.size());
   
    Object[] args = testCDXServer.capturedArgs.get(0);
    //CDXQuery query = (CDXQuery)args[0];
View Full Code Here

      wbr.setReplayTimestamp(payloadTimestamp);
      wbr.setAnchorTimestamp(payloadTimestamp);
      wbr.setTimestampSearchKey(true);
      wbr.setRequestUrl(payloadUri);

      SearchResults results = queryIndex(wbr);
     
      if(!(results instanceof CaptureSearchResults)) {
        throw new ResourceNotAvailableException("Bad results looking up " + payloadTimestamp + " " + payloadUri);
      }
      CaptureSearchResults payloadCaptureResults = (CaptureSearchResults) results;
View Full Code Here

      if (this.getMementoHandler().renderMementoTimemap(wbRequest, httpRequest, httpResponse)) {
        return;
      }
    }
   
    SearchResults results = queryIndex(wbRequest);
   
    p.queried();
   
    if(results instanceof CaptureSearchResults) {
      CaptureSearchResults cResults = (CaptureSearchResults) results;
View Full Code Here

    //Do local access/url validation check   
        //AuthToken waybackAuthToken = new AuthToken(wbRequest.get(CDXServer.CDX_AUTH_TOKEN));
        AuthToken waybackAuthToken = createAuthToken(wbRequest, urlkey);
       
        CDXToSearchResultWriter resultWriter = null;
        SearchResults searchResults = null;
       
        if (wbRequest.isReplayRequest() || wbRequest.isCaptureQueryRequest()) {
      resultWriter = this.getCaptureSearchWriter(wbRequest, waybackAuthToken, false);
        } else if (wbRequest.isUrlQueryRequest()) {
      resultWriter = this.getUrlSearchWriter(wbRequest);
        } else {
          throw new BadQueryException("Unknown Query Type");
        }

        try {
          loadWaybackCdx(urlkey, wbRequest, resultWriter.getQuery(), waybackAuthToken, resultWriter, false);
         
            if (resultWriter.getErrorMsg() != null) {
              throw new BadQueryException(resultWriter.getErrorMsg());
            }
         
            searchResults = resultWriter.getSearchResults();
           
            if ((searchResults.getReturnedCount() == 0) && (wbRequest.isReplayRequest() || wbRequest.isCaptureQueryRequest()) && tryFuzzyMatch) {
        resultWriter = this.getCaptureSearchWriter(wbRequest, waybackAuthToken, true);
             
              if (resultWriter != null) {     
                loadWaybackCdx(urlkey, wbRequest, resultWriter.getQuery(), waybackAuthToken, resultWriter, true);
               
                  searchResults = resultWriter.getSearchResults();
              }
            }
           
            if (searchResults.getReturnedCount() == 0) {
              throw new ResourceNotInArchiveException(wbRequest.getRequestUrl() + " was not found");
            }
                   
        } catch (IOException e) {
          throw new ResourceIndexNotAvailableException(e.toString());
View Full Code Here

      PerfStats.timeStart(PerfStat.IndexLoad);
     
      String format = wbRequest.getMementoTimemapFormat();
     
      if ((format != null) && format.equals(MementoConstants.FORMAT_LINK)) {
        SearchResults cResults = wbRequest.getAccessPoint().queryIndex(wbRequest);
        MementoUtils.printTimemapResponse((CaptureSearchResults)cResults, wbRequest, response);       
        return true;
      }
     
      CDXQuery query = new CDXQuery(wbRequest.getRequestUrl());
View Full Code Here

      if (wbRequest.isAnyEmbeddedContext() || wbRequest.isIdentityContext()) {
        wbRequest.setTimestampSearchKey(true);
      }
    }
   
    SearchResults results = queryIndex(wbRequest);
    p.queried();
   
    if(!(results instanceof CaptureSearchResults)) {
      throw new ResourceNotAvailableException("Bad results...");
    }
View Full Code Here

TOP

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

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.