Package org.apache.lucene.document

Examples of org.apache.lucene.document.Fieldable.stringValue()


                }
                if (value == null) {
                    if (field.isBinary()) {
                        value = field.getBinaryValue();
                    } else {
                        value = field.stringValue();
                    }
                }

                if (searchHit.fieldsOrNull() == null) {
                    searchHit.fields(new HashMap<String, SearchHitField>(2));
View Full Code Here


            if (uidField != null) {
                // we don't need to add it as a full uid field in nested docs, since we don't need versioning
                // we also rely on this for UidField#loadVersion

                // this is a deeply nested field
                if (uidField.stringValue() != null) {
                    nestedDoc.add(new Field(UidFieldMapper.NAME, uidField.stringValue(), Field.Store.NO, Field.Index.NOT_ANALYZED));
                } else {
                    nestedDoc.add(new Field(UidFieldMapper.NAME, ((UidField) uidField).uid(), Field.Store.NO, Field.Index.NOT_ANALYZED));
                }
            }
View Full Code Here

                // we don't need to add it as a full uid field in nested docs, since we don't need versioning
                // we also rely on this for UidField#loadVersion

                // this is a deeply nested field
                if (uidField.stringValue() != null) {
                    nestedDoc.add(new Field(UidFieldMapper.NAME, uidField.stringValue(), Field.Store.NO, Field.Index.NOT_ANALYZED));
                } else {
                    nestedDoc.add(new Field(UidFieldMapper.NAME, ((UidField) uidField).uid(), Field.Store.NO, Field.Index.NOT_ANALYZED));
                }
            }
            // the type of the nested doc starts with __, so we can identify that its a nested one in filters
View Full Code Here

        byte[] json = copyToBytesFromClasspath("/org/elasticsearch/index/mapper/multifield/test-data.json");
        Document doc = docMapper.parse(json).rootDoc();

        Fieldable f = doc.getFieldable("name");
        assertThat(f.name(), equalTo("name"));
        assertThat(f.stringValue(), equalTo("some name"));
        assertThat(f.isStored(), equalTo(true));
        assertThat(f.isIndexed(), equalTo(true));

        f = doc.getFieldable("name.indexed");
        assertThat(f.name(), equalTo("name.indexed"));
View Full Code Here

        assertThat(f.isStored(), equalTo(true));
        assertThat(f.isIndexed(), equalTo(true));

        f = doc.getFieldable("name.indexed");
        assertThat(f.name(), equalTo("name.indexed"));
        assertThat(f.stringValue(), equalTo("some name"));
        assertThat(f.isStored(), equalTo(false));
        assertThat(f.isIndexed(), equalTo(true));

        f = doc.getFieldable("name.not_indexed");
        assertThat(f.name(), equalTo("name.not_indexed"));
View Full Code Here

        assertThat(f.isStored(), equalTo(false));
        assertThat(f.isIndexed(), equalTo(true));

        f = doc.getFieldable("name.not_indexed");
        assertThat(f.name(), equalTo("name.not_indexed"));
        assertThat(f.stringValue(), equalTo("some name"));
        assertThat(f.isStored(), equalTo(true));
        assertThat(f.isIndexed(), equalTo(false));

        f = doc.getFieldable("object1.multi1");
        assertThat(f.name(), equalTo("object1.multi1"));
View Full Code Here

        f = doc.getFieldable("object1.multi1");
        assertThat(f.name(), equalTo("object1.multi1"));

        f = doc.getFieldable("object1.multi1.string");
        assertThat(f.name(), equalTo("object1.multi1.string"));
        assertThat(f.stringValue(), equalTo("2010-01-01"));
    }

    @Test public void testBuildThenParse() throws Exception {
        DocumentMapperParser mapperParser = MapperTests.newParser();
View Full Code Here

        byte[] json = copyToBytesFromClasspath("/org/elasticsearch/index/mapper/multifield/test-data.json");
        Document doc = docMapper.parse(json).rootDoc();

        Fieldable f = doc.getFieldable("name");
        assertThat(f.name(), equalTo("name"));
        assertThat(f.stringValue(), equalTo("some name"));
        assertThat(f.isStored(), equalTo(true));
        assertThat(f.isIndexed(), equalTo(true));

        f = doc.getFieldable("name.indexed");
        assertThat(f.name(), equalTo("name.indexed"));
View Full Code Here

        assertThat(f.isStored(), equalTo(true));
        assertThat(f.isIndexed(), equalTo(true));

        f = doc.getFieldable("name.indexed");
        assertThat(f.name(), equalTo("name.indexed"));
        assertThat(f.stringValue(), equalTo("some name"));
        assertThat(f.isStored(), equalTo(false));
        assertThat(f.isIndexed(), equalTo(true));

        f = doc.getFieldable("name.not_indexed");
        assertThat(f.name(), equalTo("name.not_indexed"));
View Full Code Here

        assertThat(f.isStored(), equalTo(false));
        assertThat(f.isIndexed(), equalTo(true));

        f = doc.getFieldable("name.not_indexed");
        assertThat(f.name(), equalTo("name.not_indexed"));
        assertThat(f.stringValue(), equalTo("some name"));
        assertThat(f.isStored(), equalTo(true));
        assertThat(f.isIndexed(), equalTo(false));
    }
}
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.