Package org.apache.lucene.document

Examples of org.apache.lucene.document.Field.fieldType()


        ColumnMapperDate mapper = new ColumnMapperDate(PATTERN);
        Field field = mapper.field("name", "2014-03-19");
        Assert.assertNotNull(field);
        Assert.assertEquals(sdf.parse("2014-03-19").getTime(), field.numericValue().longValue());
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(false, field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here


        ColumnMapperBigDecimal mapper = new ColumnMapperBigDecimal(4, 4);
        Field field = mapper.field("name", 42.43);
        Assert.assertNotNull(field);
        Assert.assertEquals("10042.4299", field.stringValue());
        Assert.assertEquals("name", field.name());
        Assert.assertFalse(field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here

        ColumnMapperLong mapper = new ColumnMapperLong(1f);
        Field field = mapper.field("name", "3.2");
        Assert.assertNotNull(field);
        Assert.assertEquals(Long.valueOf(3), field.numericValue());
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(false, field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here

        ColumnMapperBlob mapper = new ColumnMapperBlob();
        Field field = mapper.field("name", "f1B2");
        Assert.assertNotNull(field);
        Assert.assertEquals("f1b2", field.stringValue());
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(false, field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here

        ColumnMapperInet mapper = new ColumnMapperInet();
        Field field = mapper.field("name", "192.168.0.13");
        Assert.assertNotNull(field);
        Assert.assertEquals("192.168.0.13", field.stringValue());
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(false, field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here

        ColumnMapperDouble mapper = new ColumnMapperDouble(1f);
        Field field = mapper.field("name", "3.2");
        Assert.assertNotNull(field);
        Assert.assertEquals(Double.valueOf(3.2d), field.numericValue());
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(false, field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here

        UUID uuid = UUID.fromString("550e8400-e29b-41d4-a716-446655440000");
        Field field = mapper.field("name", uuid);
        Assert.assertNotNull(field);
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(uuid.toString(), field.stringValue());
        Assert.assertFalse(field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here

        ColumnMapperString mapper = new ColumnMapperString();
        Field field = mapper.field("name", "hello");
        Assert.assertNotNull(field);
        Assert.assertEquals("hello", field.stringValue());
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(false, field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here

        ColumnMapperInteger mapper = new ColumnMapperInteger(1f);
        Field field = mapper.field("name", "3.2");
        Assert.assertNotNull(field);
        Assert.assertEquals(Integer.valueOf(3), field.numericValue());
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(false, field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
View Full Code Here

        ColumnMapperText mapper = new ColumnMapperText("org.apache.lucene.analysis.en.EnglishAnalyzer");
        Field field = mapper.field("name", "hello");
        Assert.assertNotNull(field);
        Assert.assertEquals("hello", field.stringValue());
        Assert.assertEquals("name", field.name());
        Assert.assertEquals(false, field.fieldType().stored());
    }

    @Test
    public void testExtractAnalyzers()
    {
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.