Package org.elasticsearch.index.mapper

Examples of org.elasticsearch.index.mapper.ParsedDocument.rootDoc()


                .endObject()
                .copiedBytes();
        ParsedDocument doc = docMapper.parse(SourceToParse.source(source).type("type").id("1"));

        assertThat(doc.rootDoc().getFieldable("_size").isStored(), equalTo(false));
        assertThat(doc.rootDoc().getFieldable("_size").tokenStreamValue(), notNullValue());
    }

    @Test public void testSizeEnabledAndStored() throws Exception {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .startObject("_size").field("enabled", true).field("store", "yes").endObject()
View Full Code Here


                .field("field", "value")
                .endObject()
                .copiedBytes();
        ParsedDocument doc = docMapper.parse(SourceToParse.source(source).type("type").id("1"));

        assertThat(doc.rootDoc().getFieldable("_size").isStored(), equalTo(true));
        assertThat(doc.rootDoc().getFieldable("_size").tokenStreamValue(), notNullValue());
    }

    @Test public void testSizeDisabled() throws Exception {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
View Full Code Here

                .endObject()
                .copiedBytes();
        ParsedDocument doc = docMapper.parse(SourceToParse.source(source).type("type").id("1"));

        assertThat(doc.rootDoc().getFieldable("_size").isStored(), equalTo(true));
        assertThat(doc.rootDoc().getFieldable("_size").tokenStreamValue(), notNullValue());
    }

    @Test public void testSizeDisabled() throws Exception {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .startObject("_size").field("enabled", false).endObject()
View Full Code Here

                .field("field", "value")
                .endObject()
                .copiedBytes();
        ParsedDocument doc = docMapper.parse(SourceToParse.source(source).type("type").id("1"));

        assertThat(doc.rootDoc().getFieldable("_size"), nullValue());
    }

    @Test public void testSizeNotSet() throws Exception {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .endObject().endObject().string();
View Full Code Here

                .field("field", "value")
                .endObject()
                .copiedBytes();
        ParsedDocument doc = docMapper.parse(SourceToParse.source(source).type("type").id("1"));

        assertThat(doc.rootDoc().getFieldable("_size"), nullValue());
    }
}
View Full Code Here

                .startObject()
                .field("field1", "value1")
                .field("field2", "value2")
                .copiedBytes());

        assertThat(doc.rootDoc().get("field1"), equalTo("value1"));
        assertThat(doc.rootDoc().get("field2"), equalTo("value2"));
    }

    @Test public void testDynamicFalse() throws IOException {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
View Full Code Here

                .field("field1", "value1")
                .field("field2", "value2")
                .copiedBytes());

        assertThat(doc.rootDoc().get("field1"), equalTo("value1"));
        assertThat(doc.rootDoc().get("field2"), equalTo("value2"));
    }

    @Test public void testDynamicFalse() throws IOException {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .field("dynamic", "false")
View Full Code Here

                .startObject()
                .field("field1", "value1")
                .field("field2", "value2")
                .copiedBytes());

        assertThat(doc.rootDoc().get("field1"), equalTo("value1"));
        assertThat(doc.rootDoc().get("field2"), nullValue());
    }


    @Test public void testDynamicStrict() throws IOException {
View Full Code Here

                .field("field1", "value1")
                .field("field2", "value2")
                .copiedBytes());

        assertThat(doc.rootDoc().get("field1"), equalTo("value1"));
        assertThat(doc.rootDoc().get("field2"), nullValue());
    }


    @Test public void testDynamicStrict() throws IOException {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
View Full Code Here

                .field("field1", "value1")
                .field("field2", "value2")
                .endObject()
                .copiedBytes());

        assertThat(doc.rootDoc().get("obj1.field1"), equalTo("value1"));
        assertThat(doc.rootDoc().get("obj1.field2"), nullValue());
    }

    @Test public void testDynamicStrictWithInnerObjectButDynamicSetOnRoot() throws IOException {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
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.