Package org.elasticsearch.index.mapper

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


                .startObject("obj1").endObject()
                .field("value1", "test1")
                .endObject()
                .copiedBytes());

        assertThat(doc.rootDoc().get("value1"), equalTo("test1"));

        doc = defaultMapper.parse("type", "1", XContentFactory.jsonBuilder()
                .startObject()
                .nullField("obj1")
                .field("value1", "test1")
View Full Code Here


                .nullField("obj1")
                .field("value1", "test1")
                .endObject()
                .copiedBytes());

        assertThat(doc.rootDoc().get("value1"), equalTo("test1"));

        doc = defaultMapper.parse("type", "1", XContentFactory.jsonBuilder()
                .startObject()
                .startObject("obj1").field("field", "value").endObject()
                .field("value1", "test1")
View Full Code Here

                .startObject("obj1").field("field", "value").endObject()
                .field("value1", "test1")
                .endObject()
                .copiedBytes());

        assertThat(doc.rootDoc().get("obj1.field"), equalTo("value"));
        assertThat(doc.rootDoc().get("value1"), equalTo("test1"));
    }
}
View Full Code Here

                .field("value1", "test1")
                .endObject()
                .copiedBytes());

        assertThat(doc.rootDoc().get("obj1.field"), equalTo("value"));
        assertThat(doc.rootDoc().get("value1"), equalTo("test1"));
    }
}
View Full Code Here

                .field("field4", "2010-01-01")
                .startArray("field5").value(1).value(2).value(3).endArray()
                .endObject()
                .copiedBytes());

        writer.addDocument(doc.rootDoc(), doc.analyzer());
        writer.addDocument(doc.rootDoc(), doc.analyzer());

        IndexReader reader = IndexReader.open(writer, true);
        IndexSearcher searcher = new IndexSearcher(reader);
View Full Code Here

                .startArray("field5").value(1).value(2).value(3).endArray()
                .endObject()
                .copiedBytes());

        writer.addDocument(doc.rootDoc(), doc.analyzer());
        writer.addDocument(doc.rootDoc(), doc.analyzer());

        IndexReader reader = IndexReader.open(writer, true);
        IndexSearcher searcher = new IndexSearcher(reader);

        TopDocs topDocs = searcher.search(mapper.mappers().smartName("field1").mapper().fieldQuery("value1", null), 10);
View Full Code Here

                .field("_parent", "1122")
                .field("x_field", "x_value")
                .endObject()
                .copiedBytes()).type("type").id("1"));

        assertThat(doc.rootDoc().get("_parent"), equalTo(Uid.createUid("p_type", "1122")));
    }

    @Test public void parentNotSetInDocSetExternally() throws Exception {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .startObject("_parent").field("type", "p_type").endObject()
View Full Code Here

                .startObject()
                .field("x_field", "x_value")
                .endObject()
                .copiedBytes()).type("type").id("1").parent("1122"));

        assertThat(doc.rootDoc().get("_parent"), equalTo(Uid.createUid("p_type", "1122")));
    }

    @Test public void parentSetInDocSetExternally() throws Exception {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .startObject("_parent").field("type", "p_type").endObject()
View Full Code Here

                .field("_parent", "1122")
                .field("x_field", "x_value")
                .endObject()
                .copiedBytes()).type("type").id("1").parent("1122"));

        assertThat(doc.rootDoc().get("_parent"), equalTo(Uid.createUid("p_type", "1122")));
    }
}
View Full Code Here

                .startObject()
                .startObject("point").field("lat", 1.2).field("lon", 1.3).endObject()
                .endObject()
                .copiedBytes());

        assertThat(doc.rootDoc().getFieldable("point.lat"), notNullValue());
        assertThat(doc.rootDoc().getFieldable("point.lat").getBinaryValue(), nullValue());
        assertThat(doc.rootDoc().getFieldable("point.lon"), notNullValue());
        assertThat(doc.rootDoc().getFieldable("point.lon").getBinaryValue(), nullValue());
        assertThat(doc.rootDoc().getFieldable("point.geohash"), nullValue());
        assertThat(doc.rootDoc().get("point"), equalTo("1.2,1.3"));
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.