Examples of SearchResults


Examples of org.archive.wayback.core.SearchResults

  private void handleQuery(WaybackRequest wbRequest,
      HttpServletRequest httpRequest, HttpServletResponse httpResponse)
  throws ServletException, IOException {

    try {
      SearchResults results = collection.getResourceIndex().query(wbRequest);
      if(results.getResultsType().equals(
          WaybackConstants.RESULTS_TYPE_CAPTURE)) {
        CaptureSearchResults cResults = (CaptureSearchResults) results;
        SearchResult closest = cResults.getClosest(wbRequest);
        closest.put(WaybackConstants.RESULT_CLOSEST_INDICATOR,
            WaybackConstants.RESULT_CLOSEST_VALUE);
View Full Code Here

Examples of org.archive.wayback.core.SearchResults

      e.printStackTrace();
      throw new ResourceIndexNotAvailableException("Unexpected SAX: " +
          e.getMessage());
    }

    SearchResults results;
    String type = wbRequest.get(WaybackConstants.REQUEST_TYPE);
    if(type.equals(WaybackConstants.REQUEST_REPLAY_QUERY) ||
        type.equals(WaybackConstants.REQUEST_URL_QUERY)) {
      results = new CaptureSearchResults();     
    } else {
      // TODO: this is wrong, but needs exploration into what NutchWax can actually do.
      throw new BadQueryException("Unable to perform path prefix requests with this index type");
    }
    NodeList channel = getSearchChannel(document);
    NodeList nodes = getSearchItems(document);

    if (channel == null || channel.getLength() != 1) {
      // TODO: better error for user:
         throw new ResourceNotInArchiveException("No results for " +
             requestUrl);
       }

       if (nodes == null) {
      // TODO: better error for user:
         throw new ResourceNotInArchiveException("No results for " +
             requestUrl);
       }

       for (int i = 0; i < nodes.getLength(); i++) {
        
           Element e = (Element) nodes.item(i);

           SearchResult result = elementToSearchResult(e);
           results.addSearchResult(result);
       }
       Element channelElement = (Element) channel.item(0);
      
       results.putFilter(WaybackConstants.RESULTS_FIRST_RETURNED,
           getNodeContent(channelElement,NUTCH_FIRST_RESULT));
      
       results.putFilter(WaybackConstants.RESULTS_NUM_RESULTS,
           getNodeContent(channelElement,NUTCH_NUM_RESULTS));
      
       results.putFilter(WaybackConstants.RESULTS_NUM_RETURNED,
           getNodeContent(channelElement,NUTCH_NUM_RETURNED));
      
       results.putFilter(WaybackConstants.RESULTS_REQUESTED,
           String.valueOf(wbRequest.getResultsPerPage()));
      
    results.putFilter(WaybackConstants.REQUEST_START_DATE,
        Timestamp.earliestTimestamp().getDateStr());
   
       results.putFilter(WaybackConstants.REQUEST_END_DATE,
           Timestamp.latestTimestamp().getDateStr());
    return results;
  }
View Full Code Here

Examples of org.eclipse.help.internal.search.SearchResults

    try {
      SearchProgressMonitor pm = SearchProgressMonitor
          .getProgressMonitor(getLocale());
      if (pm.isDone()) {
        this.indexCompletion = 100;
        SearchResults results = createHitCollector();
        BaseHelpSystem.getSearchManager().search(createSearchQuery(),
            results, pm);
        hits = results.getSearchHits();
        if (hits == null) {
          HelpWebappPlugin
              .logWarning("No search results returned.  Help index is in use."); //$NON-NLS-1$
        }
        return;
View Full Code Here

Examples of org.glassfish.samples.twitter.api.SearchResults

            out.println("<head>");
            out.println("<title>Servlet TestServlet</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Servlet TestServlet at " + request.getContextPath() + "</h1>");
            SearchResults results = twitter.search("%23javaone%20%23javaee7%20%23q1", SearchResults.class);
            for (SearchResultsTweet tweet : results.getResults()) {
                tweet.getFrom_user();
            }
            out.println("</body>");
            out.println("</html>");
        }
View Full Code Here

Examples of org.jasig.portal.search.SearchResults

        when(portletRequest.getProperty("REMOTE_ADDR")).thenReturn("128.104.17.46");
       
        final SearchRequest query = new SearchRequest();
        query.setSearchTerms("news");
       
        final SearchResults results = googleSearchController.getSearchResults(portletRequest, query);

        assertNotNull(results);
        assertEquals(8, results.getSearchResult().size());
    }
View Full Code Here

Examples of org.neo4j.collections.rtree.filter.SearchResults


  @Override
  public SearchResults searchIndex(SearchFilter filter) {
        long start = System.currentTimeMillis();     
      SearchResults result = spatialIndex.searchIndex(filter);
        long stop = System.currentTimeMillis();
        System.out.println("# exec time(getAllIndexedNodes()): " + (stop - start) + "ms");     
      return result;
  }
View Full Code Here

Examples of org.neo4j.gis.spatial.rtree.filter.SearchResults


  @Override
  public SearchResults searchIndex(SearchFilter filter) {
        long start = System.currentTimeMillis();
        SearchResults results = spatialIndex.searchIndex(filter);
        long stop = System.currentTimeMillis();
        System.out.println("# exec time(executeSearch(" + filter + ")): " + (stop - start) + "ms");
    return results;
  }
View Full Code Here

Examples of org.olat.core.commons.services.search.SearchResults

  // TODO: chg: synchonized fix IOException: The handle is invalid, perhaps can be removed with newer lucene version.
  public SearchResults doSearch(String query, Identity identity, Roles roles, boolean doHighlighting) throws ServiceNotAvailableException, ParseException, QueryException {
    boolean doLog = log.isDebug();
    long start = 0;
    if (doLog) start = System.currentTimeMillis();   
    SearchResults searchResults = search.doSearch(query, identity, roles, doHighlighting);

    if (doLog) {
      long searchTime = (System.currentTimeMillis() - start);
      log.debug("Search query: " + query + " time: " + searchTime);
    }
View Full Code Here

Examples of org.olat.core.commons.services.search.SearchResults

    }
    Session session = null;
    try{
      Identity identity = ManagerFactory.getManager().loadIdentityByKey(searchRequest.getIdentityId());
 
      SearchResults searchResults = this.doSearch(searchRequest.getQueryString(), identity, searchRequest.getRoles(), searchRequest
          .isDoHighlighting());
      if (log_.isDebug()) {
        log_.debug("searchResults: " + searchResults.getLength());
      }
      if (searchResults != null) {
        session = acquireSession();
        Message responseMessage = session.createObjectMessage(searchResults);
        responseMessage.setJMSCorrelationID(correlationID);
View Full Code Here

Examples of org.olat.core.commons.services.search.SearchResults

      }
     
      getHighlightWords(searchString);
     
      query = getQueryString(searchString, condSearchString, parentCtxt, docType, rsrcUrl, false);
      SearchResults searchResults = searchCache.get(query);
      if(searchResults == null) {
        searchResults = searchService.doSearch(query, ureq.getIdentity(), ureq.getUserSession().getRoles(), true);
        searchCache.put(query, searchResults);
     
      if (searchResults.getList().isEmpty() && !query.endsWith(FUZZY_SEARCH)) {
        // result-list was empty => first try to find word via spell-checker
        if (doSpellCheck) {
          Set<String> didYouMeansWords = searchService.spellCheck(query);
          if (didYouMeansWords != null && !didYouMeansWords.isEmpty()) {
            setDidYouMeanWords(didYouMeansWords);
          } else {
            searchResults = doFuzzySearch(ureq, searchString, condSearchString, parentCtxt, docType, rsrcUrl);
          }
        } else {
          searchResults = doFuzzySearch(ureq, searchString, condSearchString, parentCtxt, docType, rsrcUrl);
        }
      }
     
      if(searchResults.getList().isEmpty()) {
        showInfo("found.no.result.try.fuzzy.search");
      }
      return searchResults;
    } catch (ParseException e) {
      if(log.isDebug()) log.debug("Query cannot be parsed: " + query);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.