Examples of SearchClient


Examples of com.araby.boss.search.SearchClient

    }

    @SuppressWarnings("deprecation")
    private static Map<Integer, Map<String, String>> getBossNewsSearch(String q) throws IOException, SearchException {

        SearchClient client = new SearchClient(API_KEY);

        NewsSearchRequest newsSerachRequest = new NewsSearchRequest(q);
        newsSerachRequest.setStart(BigInteger.valueOf(0));
        newsSerachRequest.setCount(30);

        NewsSearchResults results = client.newsSearch(newsSerachRequest);

        return results.getNewsSearchResultsAsMap();

    }
View Full Code Here

Examples of com.araby.boss.search.SearchClient

    }

    @SuppressWarnings("deprecation")
    private static Map<Integer, Map<String, String>> getBossImageSearch(String q) throws IOException, SearchException {

        SearchClient client = new SearchClient(API_KEY);

        ImageSearchRequest imgSerachRequest = new ImageSearchRequest(q);
        imgSerachRequest.setStart(BigInteger.valueOf(0));
        imgSerachRequest.setCount(30);

        ImageSearchResults results = client.imageSearch(imgSerachRequest);

        return results.getImageSearchResultsAsMap();

    }
View Full Code Here

Examples of com.araby.boss.search.SearchClient

    }

    @SuppressWarnings("deprecation")
    private static Map<Integer, Map<String, String>> getBossWebSearch(String q) throws IOException, SearchException {
        SearchClient client = new SearchClient(API_KEY);

        WebSearchRequest webSerachRequest = new WebSearchRequest(q);
        webSerachRequest.setStart(BigInteger.valueOf(0));
        webSerachRequest.setCount(30);
        webSerachRequest.setSimilarOk(true);


        WebSearchResults results = client.webSearch(webSerachRequest);

        return results.getWebSearchResultsAsMap();

    }
View Full Code Here

Examples of com.araby.boss.search.SearchClient

        return results.getWebSearchResultsAsMap();

    }

    private static String getBossSuggestionSearch(String q) throws IOException, SearchException {
        SearchClient client = new SearchClient(API_KEY);

        SpellingSuggestionRequest spellSerachRequest = new SpellingSuggestionRequest(q);

        SpellingSuggestionResults result = client.spellingSuggestion(spellSerachRequest);

        return result.getSuggestion();
    }
View Full Code Here

Examples of com.esri.gpt.catalog.arcgis.agportal.client.SearchClient

      final String startDcTemplate = "<?xml version=\"1.0\"?><rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:ows=\"http://www.opengis.net/ows\" xmlns:dct=\"http://purl.org/dc/terms/\" xmlns:dcmiBox=\"http://dublincore.org/documents/2000/07/11/dcmi-box/\">";
      final String endDcTemplate = "</rdf:Description></rdf:RDF>";

      if (sr==null) {
        SearchClient sc = new SearchClient(info.getUrl());
        sr = sc.listAll();
      } else {
        sr = sr.next();
      }
     
      if (sr!=null) {
View Full Code Here

Examples of org.sonar.server.search.SearchClient

  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      searchClient.prepareDeleteByQuery(IndexDefinition.RULE.getIndexName()).setQuery(QueryBuilders.matchAllQuery()).get();

      // expected to fail because elasticsearch is not correctly configured, but that does not matter
      fail();
    } catch (IllegalStateException e) {
      assertThat(e.getMessage()).isEqualTo("Fail to execute ES delete by query request on indices 'rules'");
View Full Code Here

Examples of org.sonar.server.search.SearchClient

  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      ClusterStatsRequestBuilder requestBuilder = searchClient.prepareClusterStats();
      requestBuilder.get();

      // expected to fail because elasticsearch is not correctly configured, but that does not matter
      fail();
    } catch (IllegalStateException e) {
View Full Code Here

Examples of org.sonar.server.search.SearchClient

  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      searchClient.prepareFlush(IndexDefinition.RULE.getIndexName()).get();

      // expected to fail because elasticsearch is not correctly configured, but that does not matter
      fail();
    } catch (IllegalStateException e) {
      assertThat(e.getMessage()).isEqualTo("Fail to execute ES flush request on indices 'rules'");
View Full Code Here

Examples of org.sonar.server.search.SearchClient

  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    BulkRequestBuilder bulkRequestBuilder = searchClient.prepareBulk();
    bulkRequestBuilder.add(new UpdateRequest(IndexDefinition.RULE.getIndexName(), IndexDefinition.RULE.getIndexName(), "rule1").doc(Collections.emptyMap()));
    bulkRequestBuilder.add(new DeleteRequest(IndexDefinition.RULE.getIndexName(), IndexDefinition.RULE.getIndexName(), "rule1"));
    bulkRequestBuilder.add(new IndexRequest(IndexDefinition.RULE.getIndexName(), IndexDefinition.RULE.getIndexName(), "rule1").source(Collections.emptyMap()));
    try {
      bulkRequestBuilder.get();
View Full Code Here

Examples of org.sonar.server.search.SearchClient

  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      searchClient.prepareSearch(IndexDefinition.RULE.getIndexName()).get();

      // expected to fail because elasticsearch is not correctly configured, but that does not matter
      fail();
    } catch (Exception e) {
      assertThat(e).isInstanceOf(IllegalStateException.class);
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.