Package org.elasticsearch.common.compress

Examples of org.elasticsearch.common.compress.CompressedString


        assertThat(parseContext.timestampResolved(), equalTo(false));
    }

    @Test
    public void testParseRoutingWithPath() throws Exception {
        MappingMetaData md = new MappingMetaData("type1", new CompressedString(""),
                new MappingMetaData.Id("obj1.id"),
                new MappingMetaData.Routing(true, "obj1.routing"),
                new MappingMetaData.Timestamp(true, "obj2.timestamp", "dateOptionalTime", TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP), false);
        byte[] bytes = jsonBuilder().startObject().field("field1", "value1").field("field2", "value2")
                .startObject("obj0").field("field1", "value1").field("field2", "value2").endObject()
View Full Code Here


        assertThat(parseContext.timestampResolved(), equalTo(false));
    }

    @Test
    public void testParseTimestampWithPath() throws Exception {
        MappingMetaData md = new MappingMetaData("type1", new CompressedString(""),
                new MappingMetaData.Id("obj1.id"),
                new MappingMetaData.Routing(true, "obj1.routing"),
                new MappingMetaData.Timestamp(true, "obj2.timestamp", "dateOptionalTime", TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP), false);
        byte[] bytes = jsonBuilder().startObject().field("field1", "value1").field("field2", "value2")
                .startObject("obj0").field("field1", "value1").field("field2", "value2").endObject()
View Full Code Here

        assertThat(parseContext.timestampResolved(), equalTo(true));
    }

    @Test
    public void testParseIdAndRoutingAndTimestampWithinSamePath() throws Exception {
        MappingMetaData md = new MappingMetaData("type1", new CompressedString(""),
                new MappingMetaData.Id("obj1.id"),
                new MappingMetaData.Routing(true, "obj1.routing"),
                new MappingMetaData.Timestamp(true, "obj1.timestamp", "dateOptionalTime", TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP), false);
        byte[] bytes = jsonBuilder().startObject().field("field1", "value1").field("field2", "value2")
                .startObject("obj0").field("field1", "value1").field("field2", "value2").endObject()
View Full Code Here

        assertThat(parseContext.timestamp(), equalTo("1"));
    }

    @Test
    public void testParseIdAndRoutingAndTimestampWithinSamePathAndMoreLevels() throws Exception {
        MappingMetaData md = new MappingMetaData("type1", new CompressedString(""),
                new MappingMetaData.Id("obj1.obj0.id"),
                new MappingMetaData.Routing(true, "obj1.obj2.routing"),
                new MappingMetaData.Timestamp(true, "obj1.obj3.timestamp", "dateOptionalTime", TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP), false);
        byte[] bytes = jsonBuilder().startObject().field("field1", "value1").field("field2", "value2")
                .startObject("obj0").field("field1", "value1").field("field2", "value2").endObject()
View Full Code Here

    }


    @Test
    public void testParseIdAndRoutingAndTimestampWithSameRepeatedObject() throws Exception {
        MappingMetaData md = new MappingMetaData("type1", new CompressedString(""),
                new MappingMetaData.Id("obj1.id"),
                new MappingMetaData.Routing(true, "obj1.routing"),
                new MappingMetaData.Timestamp(true, "obj1.timestamp", "dateOptionalTime", TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP), false);
        byte[] bytes = jsonBuilder().startObject().field("field1", "value1").field("field2", "value2")
                .startObject("obj0").field("field1", "value1").field("field2", "value2").endObject()
View Full Code Here

    }

    //
    @Test
    public void testParseIdRoutingTimestampWithRepeatedField() throws Exception {
        MappingMetaData md = new MappingMetaData("type1", new CompressedString(""),
                new MappingMetaData.Id("field1"),
                new MappingMetaData.Routing(true, "field1.field1"),
                new MappingMetaData.Timestamp(true, "field1", "dateOptionalTime", TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP), false);

        byte[] bytes = jsonBuilder().startObject()
View Full Code Here

        assertThat(parseContext.timestamp(), equalTo("foo"));
    }

    @Test
    public void testParseNoIdRoutingWithRepeatedFieldAndObject() throws Exception {
        MappingMetaData md = new MappingMetaData("type1", new CompressedString(""),
                new MappingMetaData.Id("id"),
                new MappingMetaData.Routing(true, "field1.field1.field2"),
                new MappingMetaData.Timestamp(true, "field1", "dateOptionalTime", TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP), false);

        byte[] bytes = jsonBuilder().startObject()
View Full Code Here

        assertThat(parseContext.timestamp(), equalTo("foo"));
    }

    @Test
    public void testParseRoutingWithRepeatedFieldAndValidRouting() throws Exception {
        MappingMetaData md = new MappingMetaData("type1", new CompressedString(""),
                new MappingMetaData.Id(null),
                new MappingMetaData.Routing(true, "field1.field2"),
                new MappingMetaData.Timestamp(true, "field1", "dateOptionalTime", TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP), false);

        byte[] bytes = jsonBuilder().startObject()
View Full Code Here

    public static CompressedString filter(FilterBuilder filterBuilder) throws IOException {
        XContentBuilder builder = XContentFactory.jsonBuilder();
        filterBuilder.toXContent(builder, ToXContent.EMPTY_PARAMS);
        builder.close();
        return new CompressedString(builder.string());
    }
View Full Code Here

        IndexService indexService = createIndex("test");
        injector = indexService.injector();

        MapperService mapperService = indexService.mapperService();
        String mapping = copyToStringFromClasspath("/org/elasticsearch/index/query/mapping.json");
        mapperService.merge("person", new CompressedString(mapping), true);
        mapperService.documentMapper("person").parse(new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/query/data.json")));
        queryParser = injector.getInstance(IndexQueryParserService.class);
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.compress.CompressedString

Copyright © 2018 www.massapicom. 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.