Package io.searchbox.client

Examples of io.searchbox.client.JestResult


        "dlspermissions", "dlspermissions", true);

    executeIndex("dls_dummy_content.json", "twitter",
        "tweet", "1", true);

    JestResult res = executeSearch("test_facet_search.json", true);
    Assert.assertTrue(res.getJsonString().contains("facets"));
    Assert.assertTrue(res.getJsonString().contains("term"));
   

  }
View Full Code Here


                "dlspermissions", "dlspermissions", true);

        executeIndex("issues/dls2/data.json", "logstash-2014.04.03",
                "log", "onelog", true);

        JestResult res = executeGet("logstash-2014.04.03","onelog", true);
        Assert.assertEquals(loadFile("issues/dls2/expected.json"), res.getJsonString());

    }
View Full Code Here

    final String [] userpass = getUserPass();

    client = getJestClient(getServerUri(),userpass[0],userpass[1]);


    final JestResult res = client.execute(new Index.Builder(loadFile(file)).index(index).type(type).id(id).refresh(true)
        .setHeader(headers).build());

    log.debug("Index operation result: " + res.getJsonString());
    if (mustBeSuccesfull) {
      Assert.assertTrue(res.isSucceeded());
    } else {
      Assert.assertTrue(!res.isSucceeded());
    }

    return res;
  }
View Full Code Here

    final String [] userpass = getUserPass();

    client = getJestClient(getServerUri(),userpass[0],userpass[1]);


    final JestResult res = client.execute(new Search.Builder(loadFile(file)).refresh(true).setHeader(headers)
        .build());

    log.debug("Search operation result: " + res.getJsonString());
    if (mustBeSuccesfull) {
      Assert.assertTrue(res.isSucceeded());
    } else {
      Assert.assertTrue(!res.isSucceeded());
    }
    return res;
  }
View Full Code Here

    final String [] userpass = getUserPass();

    client = getJestClient(getServerUri(),userpass[0],userpass[1]);


    final JestResult res = client.execute(new Get.Builder(index, id).refresh(true).setHeader(headers)
        .build());

    log.debug("Search operation result: " + res.getJsonString());
    if (mustBeSuccesfull) {
      Assert.assertTrue(res.isSucceeded());
    } else {
      Assert.assertTrue(!res.isSucceeded());
    }
    return res;
  }
View Full Code Here

            searchBuilder = searchQueryBuilder.forQuery(term, pageable, filter);
        }
        searchBuilder.addIndex(index);
        Search search = searchBuilder.build();
        logger.debug(search.getData());
        JestResult jestResult = execute(search);
        return searchResultParser.parseResults(jestResult, pageable, term);
    }
View Full Code Here

        execute(new DeleteByQuery.Builder(query).build());
    }

    private JestResult execute(Action action) {
        try {
            JestResult result = jestClient.execute(action);
            logger.debug(result.getJsonString());
            if(!result.isSucceeded()) {
                logger.warn("Failed to execute Elastic Search action: " + result.getErrorMessage());
            }
            return result;
        } catch (Exception e) {
            throw new SearchException(e);
        }
View Full Code Here

    @Before
    public void setup() {
        JsonParser jsonParser = new JsonParser();
        searchResultParser = new SearchResultParser();
        JestResult jestResult = new JestResult();
        jestResult.setJsonObject(jsonParser.parse(RESULT_STRING).getAsJsonObject());

        Pageable pageable = new PageRequest(3, 12);
        searchResults = searchResultParser.parseResults(jestResult, pageable, "search term");
        content = searchResults.getPage().getContent();
    }
View Full Code Here

        searchService.removeFromIndex(entry);
    }

    @Test
    public void usesTheSearchEntriesType() throws Exception {
        given(jestClient.execute(any(Action.class))).willReturn(new JestResult());
        searchService.saveToIndex(entry);
        verify(jestClient).execute(argThat(new ArgumentMatcher<Action>() {
            @Override
            public boolean matches(Object item) {
                Index action = (Index) item;
View Full Code Here

        }));
    }

    @Test
    public void handlesNullFilters() throws Exception {
        given(jestClient.execute(any(Action.class))).willReturn(new JestResult());
        searchService.search("foo", mock(Pageable.class), null);
    }
View Full Code Here

TOP

Related Classes of io.searchbox.client.JestResult

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.