Examples of SearchResponse


Examples of com.akdeniz.googleplaycrawler.GooglePlay.SearchResponse

    Assert.assertFalse(listResponse.getDocList().isEmpty());
  }

  @Test(dependsOnMethods = { "shouldLogin" })
  public void shouldSearch() throws Exception {
    SearchResponse searchResponse = service.search("criticker");
    Assert.assertFalse(searchResponse.getDoc(0).getChildList().isEmpty());
  }
View Full Code Here

Examples of com.akdeniz.googleplaycrawler.GooglePlay.SearchResponse

  String query = namespace.getString("query");
  Integer offset = namespace.getInt("offset");
  Integer number = namespace.getInt("number");

  SearchResponse searchResponse = service.search(query, offset, number);
  System.out.println(LIST_HEADER);
  for (DocV2 child : searchResponse.getDoc(0).getChildList()) {
      AppDetails appDetails = child.getDetails().getAppDetails();
      String formatted = new StringJoiner(DELIMETER).add(child.getTitle()).add(appDetails.getPackageName())
        .add(child.getCreator()).add(child.getOffer(0).getFormattedAmount())
        .add(String.valueOf(appDetails.getInstallationSize())).add(appDetails.getNumDownloads()).toString();
      System.out.println(formatted);
View Full Code Here

Examples of com.bugyal.imentor.frontend.shared.SearchResponse

  @Override
  public SearchResponse filterList(double latitude, double longitude,
      String strlocation, int radius, List<String> hasSubs,
      List<String> needSubs) {
    SearchResponse response = new SearchResponse();
    Participant pi;
    Point pt = new Point(latitude, longitude);
    try {
      Set<String> hasSubjects = new HashSet<String>();
      Set<String> needSubjects = new HashSet<String>();

      for (String s : hasSubs) {
        hasSubjects.add(s);
      }
      for (String s : needSubs) {
        needSubjects.add(s);
      }

      List<SearchResult> has = new ArrayList<SearchResult>();
      List<SearchResult> need = new ArrayList<SearchResult>();

      Location location = new Location(latitude, longitude, strlocation,
          radius);
      long temp = System.currentTimeMillis();
      List<Participant> participants = pm.searchParticipantsBySubjects(
          needSubs, location, true);
      pi= pm.findParticipantByEmail(getUserId());
      LOG.info("For TOME searchParticipantsBySubjects(needSubs,location, true) "
              + (System.currentTimeMillis() - temp));

      for (Participant p : participants) {
        List<String> matchingSubs = new ArrayList<String>();
        for (String s : p.getHasSubjects()) {
          if (needSubjects.contains(s)) {
            matchingSubs.add(s);
          }
        }
        has.add(new SearchResult(ValueObjectGenerator.create(p), true,
            matchingSubs, GeocellUtils
                .distance(pt, p.getLocation())));
      }
      temp = System.currentTimeMillis();
      participants = pm.searchParticipantsBySubjects(hasSubs, location,
          false);
      LOG.info("For TOME searchParticipantsBySubjects(hasSubs, location, false) "
              + (System.currentTimeMillis() - temp));

      for (Participant p : participants) {
        List<String> matchingSubs = new ArrayList<String>();
        for (String s : p.getNeedSubjects()) {
          if (hasSubjects.contains(s)) {
            matchingSubs.add(s);
          }
        }
        need.add(new SearchResult(ValueObjectGenerator.create(p),
            false, matchingSubs, GeocellUtils.distance(pt, p
                .getLocation())));
      }
      temp = System.currentTimeMillis();
      List<Opportunity> opportunities = om.searchOpportunities(location,
          hasSubs);
      LOG.info("For TOME searchOpportunities(location, hasSubs) "
          + (System.currentTimeMillis() - temp));

      for (Opportunity o : opportunities) {

        List<String> matchingSubs = new ArrayList<String>();
        for (String s : o.getSubjects()) {
          if (hasSubjects.contains(s)) {
            matchingSubs.add(s);
          }
        }
        need.add(new SearchResult(ValueObjectGenerator.create(o),
            matchingSubs, GeocellUtils
                .distance(pt, o.getLocation())));
      }
           
      for(SearchResult s: need) {
        if(s.isTypeParticipant()) {
          if(s.getP().getEmail().equals(pi.getEmail())) {
            need.remove(s);
          }
        }
      }
      for(SearchResult s: has) {
        if(s.getP().getEmail().equals(pi.getEmail())) {
          has.remove(s);         
        }
      }
      response.setHas(has);
      response.setNeed(need);
      return response;
    } catch (MentorException e) {
      e.printStackTrace();
    }
    return response;
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.action.search.SearchResponse

          bw.write(MAPPING_MARKER);
          bw.write(mapping);
          bw.newLine();

          // setting up the search for all content
      SearchResponse scrollResp = client.prepareSearch(index).setSearchType(SearchType.SCAN).setQuery(QueryBuilders.matchAllQuery())
          .setSize(100).setScroll(TimeValue.timeValueMinutes(2)).execute().actionGet();
      while (true) {
        scrollResp = client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(TimeValue.timeValueMinutes(2)).execute()
            .actionGet();
        boolean hitsRead = false;
        for (SearchHit hit : scrollResp.getHits()) {
          bw.write(hit.getId());
          bw.write(JSON_RECORD_DELIMITER);
          bw.write(hit.sourceAsString());
          bw.newLine();
          hitsRead = true;
View Full Code Here

Examples of net.rim.device.api.unifiedsearch.SearchResponse

            _displayables = new Vector();
        } else {
            _displayables.removeAllElements();
        }

        SearchResponse results = null;
        final UnifiedSearchServices services =
                UnifiedSearchServices.getInstance();

        // Retrieve searchables
        final Vector vector =
View Full Code Here

Examples of oracle.security.idm.SearchResponse

                        idStore.getSimpleSearchFilter(RoleProfile.NAME,
                                                      SimpleSearchFilter.TYPE_EQUAL,
                                                      this.createUserRole);
              SearchParameters sp = new SearchParameters(filter,
                                                         SearchParameters.SEARCH_ROLES_ONLY);
              SearchResponse response = idStore.search(sp);
              if (response.hasNext()) {
                Role role = (Role)response.next();
                idStore.getRoleManager().grantRole(role, newUser.getPrincipal());
              }
          }
          ModProperty userAccountControl =
              new ModProperty("userAccountControl",
View Full Code Here

Examples of org.amdatu.search.SearchResponse

  }

  @Override
  public List<Product> findProducts(String query) {
    try {
      SearchResponse select = search.select(query, 0, 10, null);
      List<Product> products = new ArrayList<>();
      for (Document document : select.getResults()) {
        Collection<Object> fieldValues = document.getFieldValues("uri");
        Iterator<Object> idIterator = fieldValues.iterator();
        while (idIterator.hasNext()) {
          try {
            products.add(productService.getProductById((String)idIterator.next()));
View Full Code Here

Examples of org.apache.directory.api.dsmlv2.reponse.SearchResponse

        assertNotNull( batchResp );

        assertEquals( 101, batchResp.getRequestID() );
       
        SearchResponse searchResp = ( SearchResponse ) batchResp.getCurrentResponse().getDecorated();

        assertEquals( 5, searchResp.getSearchResultEntryList().size() );
    }
View Full Code Here

Examples of org.apache.directory.api.dsmlv2.reponse.SearchResponse

        assertNotNull( batchResp );
       
        assertEquals( 101, batchResp.getRequestID() );
       
        SearchResponse searchResp = ( SearchResponse ) batchResp.getCurrentResponse().getDecorated();

        assertEquals( 5, searchResp.getSearchResultEntryList().size() );
    }
View Full Code Here

Examples of org.apache.directory.ldap.client.api.message.SearchResponse

            {
                Cursor<SearchResponse> cursor = connection.search( config.getBaseDn(), config.getFilter(), SearchScope.getSearchScope( config.getSearchScope() ), config.getAttributes() );
                cursor.beforeFirst();
                if( cursor.next() && cursor.next() ) // to skip the baseDN
                {
                    SearchResponse res = cursor.get();
                    if( res instanceof SearchResultEntry )
                    {
                        connection.delete( ( ( SearchResultEntry ) res ).getEntry().getDn()  );
                    }
                }
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.