Examples of PutIndexedScriptResponse


Examples of org.elasticsearch.action.indexedscripts.put.PutIndexedScriptResponse

    @Test(expected = SearchPhaseExecutionException.class)
    public void testIndexedTemplateClient() throws Exception {
        createIndex(ScriptService.SCRIPT_INDEX);
        ensureGreen(ScriptService.SCRIPT_INDEX);

        PutIndexedScriptResponse scriptResponse = client().preparePutIndexedScript("mustache", "testTemplate", "{" +
                "\"template\":{" +
                "                \"query\":{" +
                "                   \"match\":{" +
                "                    \"theField\" : \"{{fieldParam}}\"}" +
                "       }" +
                "}" +
                "}").get();

        assertTrue(scriptResponse.isCreated());

        scriptResponse = client().preparePutIndexedScript("mustache", "testTemplate", "{" +
                "\"template\":{" +
                "                \"query\":{" +
                "                   \"match\":{" +
                "                    \"theField\" : \"{{fieldParam}}\"}" +
                "       }" +
                "}" +
                "}").get();

        assertEquals(scriptResponse.getVersion(), 2);

        GetIndexedScriptResponse getResponse = client().prepareGetIndexedScript("mustache", "testTemplate").get();
        assertTrue(getResponse.isExists());

        List<IndexRequestBuilder> builders = new ArrayList<>();
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.