Package org.elasticsearch.index.fieldvisitor

Examples of org.elasticsearch.index.fieldvisitor.CustomFieldsVisitor.fields()


        // Make sure the doc gets loaded as if it was stored in the new way
        fieldsVisitor.reset();
        searcher.doc(1, fieldsVisitor);
        fieldsVisitor.postProcess(mapper);
        assertThat(fieldsVisitor.fields().size(), equalTo(3));
        assertThat(fieldsVisitor.fields().get("field1").size(), equalTo(1));
        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
View Full Code Here


        // Make sure the doc gets loaded as if it was stored in the new way
        fieldsVisitor.reset();
        searcher.doc(1, fieldsVisitor);
        fieldsVisitor.postProcess(mapper);
        assertThat(fieldsVisitor.fields().size(), equalTo(3));
        assertThat(fieldsVisitor.fields().get("field1").size(), equalTo(1));
        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
View Full Code Here

        fieldsVisitor.reset();
        searcher.doc(1, fieldsVisitor);
        fieldsVisitor.postProcess(mapper);
        assertThat(fieldsVisitor.fields().size(), equalTo(3));
        assertThat(fieldsVisitor.fields().get("field1").size(), equalTo(1));
        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(1), equalTo(2l));
View Full Code Here

        searcher.doc(1, fieldsVisitor);
        fieldsVisitor.postProcess(mapper);
        assertThat(fieldsVisitor.fields().size(), equalTo(3));
        assertThat(fieldsVisitor.fields().get("field1").size(), equalTo(1));
        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(1), equalTo(2l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(2), equalTo(3l));
View Full Code Here

        fieldsVisitor.postProcess(mapper);
        assertThat(fieldsVisitor.fields().size(), equalTo(3));
        assertThat(fieldsVisitor.fields().get("field1").size(), equalTo(1));
        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(1), equalTo(2l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(2), equalTo(3l));
View Full Code Here

        assertThat(fieldsVisitor.fields().size(), equalTo(3));
        assertThat(fieldsVisitor.fields().get("field1").size(), equalTo(1));
        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(1), equalTo(2l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(2), equalTo(3l));

        reader.close();
View Full Code Here

        assertThat(fieldsVisitor.fields().get("field1").size(), equalTo(1));
        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(1), equalTo(2l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(2), equalTo(3l));

        reader.close();
        writer.close();
View Full Code Here

        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(1), equalTo(2l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(2), equalTo(3l));

        reader.close();
        writer.close();
    }
View Full Code Here

        assertThat(fieldsVisitor.fields().get("field2").size(), equalTo(1));
        assertThat((Float) fieldsVisitor.fields().get("field2").get(0), equalTo(1.1f));
        assertThat(fieldsVisitor.fields().get("field3").size(), equalTo(3));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(1), equalTo(2l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(2), equalTo(3l));

        reader.close();
        writer.close();
    }
}
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.