Examples of SearchResult


Examples of com.esri.gpt.catalog.search.SearchResult

    status.setStartTimestamp(new Timestamp(System.currentTimeMillis()));
  
    if (this.isTimeUp()) {
      throw new Exception("This thread has been stopped");
    }
    SearchResult result = new SearchResult();
    SearchCriteria criteria = this.getSearchContext().getSearchCriteria();
    ASearchEngine engine = this.getSearchEngine();
    engine.setRequestDefinition(new SearchRequestDefinition(criteria, result));
    engine.setHitsOnly(true);
    engine.setConnectionTimeoutMs(this.getMaxSearchTime());
    engine.setResponseTimeout(this.getMaxSearchTime());

    if (LOG.isLoggable(Level.FINER)) {
      LOG.finer("Starting SEARCH IN thread id= " + this.getId() + ", rid="
          + this.getRID());
    }
    if (this.rid.equalsIgnoreCase("local")) {
      GetRecordsGenerator grg = new GetRecordsGenerator(rc);
      if (engine.getHitsOnly()) {
        grg.setResultType("HITS");
      }
      String cswRequest = grg.generateCswRequest(query);
      SearchEngineCSW csw = (SearchEngineCSW) engine;
      if (this.isTimeUp()) {
        throw new Exception("This threads time is up");
      }
      csw.doSearch(cswRequest);
    } else {
      if (this.isTimeUp()) {
        throw new Exception("This threads time is up");
      }
      engine.doSearch();
    }
    if (LOG.isLoggable(Level.FINER)) {
      LOG.finer("ENDING SEARCH IN thread id= " + this.getId() + ", rid="
          + this.getRID());
    }
    status.setHitCount(result.getMaxQueryHits());
    this.getSearchStatus().setEndTimestamp(
        new Timestamp(System.currentTimeMillis()));
    this.writeStatus(SearchStatus.STATUSTYPE_COMPLETED);
   
  } catch (Exception e) {
View Full Code Here

Examples of com.flaptor.indextank.search.SearchResult

        // adds fetch variables to the transform function
        if ("*".equals(fetchVariables) || "true".equalsIgnoreCase(fetchVariables)) {
            transformFunction = new Function<ScoredMatch, SearchResult>() {
                @Override
                public SearchResult apply(ScoredMatch scoredMatch) {
                    SearchResult searchResult = baseTransform.apply(scoredMatch);
                    searchResult.setVariables(boostsManager.getVariablesAsMap(scoredMatch.getDocId()));
                    return searchResult;
                }
            };
        }

        // adds fetch categories to the transform function
        final Function<ScoredMatch, SearchResult> prevTransform = transformFunction;
        if ("*".equals(fetchCategories) || "true".equalsIgnoreCase(fetchCategories)) {
            transformFunction = new Function<ScoredMatch, SearchResult>() {
                @Override
                public SearchResult apply(ScoredMatch scoredMatch) {
                    SearchResult searchResult = prevTransform.apply(scoredMatch);
                    searchResult.setCategories(boostsManager.getCategoryValues(scoredMatch.getDocId()));
                    return searchResult;
                }
            };
        }
       
View Full Code Here

Examples of com.gitblit.models.SearchResult

    Repository repository = GitBlitSuite.getHelloworldRepository();
    RepositoryModel model = newRepositoryModel(repository);
    lucene.reindex(model, repository);
    repository.close();

    SearchResult result = lucene.search("type:blob AND path:bit.bit", 1, 1, model.name).get(0);
    assertEquals("Mike Donaghy", result.author);
    result = lucene.search("type:blob AND path:clipper.prg", 1, 1, model.name).get(0);
    assertEquals("tinogomes", result.author);

    // reindex JGit
View Full Code Here

Examples of com.google.api.services.youtube.model.SearchResult

            System.out.println(" There aren't any results for your query.");
        }

        while (iteratorSearchResults.hasNext()) {

            SearchResult singleVideo = iteratorSearchResults.next();
            ResourceId rId = singleVideo.getId();

            // Confirm that the result represents a video. Otherwise, the
            // item will not contain a video ID.
            if (rId.getKind().equals("youtube#video")) {
                Thumbnail thumbnail = singleVideo.getSnippet().getThumbnails().getDefault();

                System.out.println(" Video Id" + rId.getVideoId());
                System.out.println(" Title: " + singleVideo.getSnippet().getTitle());
                System.out.println(" Thumbnail: " + thumbnail.getUrl());
                System.out.println("\n-------------------------------------------------------------\n");
            }
        }
    }
View Full Code Here

Examples of com.google.collide.dto.SearchResult

  private void showResultsImpl(final int page, int pageCount, JsoArray<SearchResult> items) {
    Css css = getView().css;
    buildPager(page, pageCount, css);

    for (int i = 0; i < items.size(); i++) {
      SearchResult item = items.get(i);
      DivElement outer = Elements.createDivElement();
      if (i > 0) {
        outer.setClassName(css.second());
      }
      final PathUtil path = new PathUtil(item.getTitle());
      AnchorElement title = Elements.createAnchorElement(css.title());
      title.setTextContent(item.getTitle());
      if (item.getUrl() != null) {
        // this is unusual, but allows search results to point outside of this
        // workspace, e.g. to language API docs.
        title.setHref(item.getUrl());
      } else {
        // this is the common case; the title will be a path in this workspace
        // and clicking on the link should take us to its editor.
        title.setOnClick(new EventListener() {
          @Override
          public void handleEvent(Event evt) {
            currentPlace.fireChildPlaceNavigation(
                FileSelectedPlace.PLACE.createNavigationEvent(path));
          }
        });
      }
      outer.appendChild(title);
      JsoArray<Snippet> snippets = (JsoArray<Snippet>) item.getSnippets();
      for (int j = 0; j < snippets.size(); j++) {
        DivElement snippetDiv = Elements.createDivElement(css.snippet());
        final int lineNo = snippets.get(j).getLineNumber();
        snippetDiv.setTextContent(lineNo + ": " + snippets.get(j).getSnippetText());
        snippetDiv.setOnClick(new EventListener() {
View Full Code Here

Examples of com.google.wave.api.SearchResult

    String title = "title";
    SearchResult.Digest digest =
        new Digest(title, "", WAVE_ID.serialise(), ImmutableList.of(PARTICIPANT.getAddress(),
            OTHER_PARTICIPANT.getAddress()), -1L, -1L, 1, 1);
    String query = "in:inbox";
    SearchResult searchResult = new SearchResult(query);
    searchResult.addDigest(digest);
    when(searchProvider.search(USER, query, 0, 10)).thenReturn(searchResult);
    service.execute(operation, context, USER);

    verify(context).constructResponse(
        eq(operation),
View Full Code Here

Examples of com.impetus.kundera.db.SearchResult

    @Test
    public void test()
    {
        Person p = new Person();
        SearchResult result = new SearchResult();
       
        result.setPrimaryKey(p.getPersonId());
        result.setEmbeddedColumnName("none");
        result.addEmbeddedColumnValue("embeddedcolumn1");
        result.addEmbeddedColumnValue("embeddedcolumn2");
       
        Assert.assertNull(result.getPrimaryKey());
        Assert.assertNotNull(result.getEmbeddedColumnName());
        Assert.assertNotNull(result.getEmbeddedColumnValues());
        Assert.assertEquals(2,result.getEmbeddedColumnValues().size());
       
    }
View Full Code Here

Examples of com.mockey.model.SearchResult

     
      // ******************************
      // SERVICE PLAN LIST
      // ******************************
      for (ServicePlan servicePlan : store.getServicePlans()) {
        SearchResult sr = buildSearchResult(term, servicePlan.getName() + " " + servicePlan.getTag());
        if (sr != null) {
          sr.setType(SearchResultType.SERVICE_PLAN);
          sr.setServicePlanId("" + servicePlan.getId());
          sr.setServicePlanName(servicePlan.getName());
          searchResultList.add(sr);
        }
      }
     
      // ******************************
      // SERVICE LIST
      // ******************************
      for (Service service : store.getServices()) {

        boolean serviceAdded = false;
        SearchResult sr = buildSearchResult(term,
            service.getServiceName() + " " +service.getTag() + " ");
        if (sr != null) {
          sr.setType(SearchResultType.SERVICE);
          sr.setServiceId("" + service.getId());
          searchResultList.add(sr);
          serviceAdded = true;
        }

        if (!serviceAdded) {
          // No match; lets check RealServiceUrls
          for (Url url : service.getRealServiceUrls()) {
            SearchResult subresult = buildSearchResult(term,
                url.toString());
            if (subresult != null) {
              subresult.setType(SearchResultType.SERVICE);
              subresult.setServiceId("" + service.getId());
              searchResultList.add(subresult);
              serviceAdded = true;
              break;
            }
          }
        }

        if (!serviceAdded) {
          // No match; lets check RealServiceUrls
          String mockurl = service.getUrl();
          SearchResult subresult = buildSearchResult(term, mockurl);
          if (subresult != null) {
            subresult.setType(SearchResultType.SERVICE);
            subresult.setServiceId("" + service.getId());
            searchResultList.add(subresult);
            serviceAdded = true;

          }

        }

        // *****************************
        // SERVICE SCENARIO
        // ****************************
        // REGARDLESS of Service being added, let's see if there is a
        // matching scenario by Scenario RESPONSE
        for (Scenario scenario : service.getScenarios()) {
          // Append tags, name, and response...
          // Why not? It's a hack to jumble all things together
          SearchResult subresult = buildSearchResult(
              term,
              scenario.getResponseMessage() + " "
                  + scenario.getScenarioName() + " "
                  + scenario.getTag());

          if (subresult != null) {
            subresult.setType(SearchResultType.SERVICE_SCENARIO);
            subresult.setServiceId("" + service.getId());
            subresult.setScenarioId("" + scenario.getId());
            subresult.setScenarioName(scenario.getScenarioName());
            searchResultList.add(subresult);
          }
        }

      }
View Full Code Here

Examples of com.netfever.site.dynovisz.web.spring.data.SearchResult

    final List<SearchResult> list = new ArrayList<>();
    final SimpleDateFormat fmt = new SimpleDateFormat("dd-MM-yyy");
    final SimpleDateFormat fmtHour = new SimpleDateFormat("hh:mm:ss");
    for (SolrDoc doc: resp.getResponse().getDocs()) {
      final SearchResult sr = new SearchResult();
     
      Date videoDate = doc.getVideodate();
      if (videoDate == null) {
        videoDate = new Date();
      }
      sr.setDate(fmt.format(videoDate));
     
      sr.setId(doc.getId());
      //sr.setImageUrl("thumbnail.spr?id=" + doc.getId());
      sr.setImageUrl(doc.getEncodedthumbnail());
      sr.setLanguage(doc.getLanguage());
      sr.setNumView("" + doc.getNumberOfView());
      sr.setPageUrl(doc.getPageurl());
      sr.setTitle(doc.getTitle());
      sr.setVideoLength(fmtHour.format(doc.getVideoLength()));
     
      list.add(sr);
    }

    searchForm.setResult(list);
View Full Code Here

Examples of com.netflix.exhibitor.core.entities.SearchResult

        if ( logSearch == null )
        {
            return Response.status(Response.Status.NOT_FOUND).build();
        }

        SearchResult    result;
        try
        {
            DateFormat      dateFormatter = new SimpleDateFormat(DATE_FORMAT_STR);
            SearchItem      item = logSearch.toResult(docId);
            if ( item == null )
            {
                return Response.status(Response.Status.NOT_FOUND).build();
            }

            byte[]          bytes = logSearch.toData(docId);
            if ( bytes == null )
            {
                bytes = new byte[0];
            }
            result = new SearchResult
            (
                docId,
                item.getType(),
                item.getPath(),
                dateFormatter.format(item.getDate()),
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.