Package org.apache.lucene.util

Examples of org.apache.lucene.util.BytesRefHash$TrackingDirectBytesStartArray


public class SerializationTest {

    @Test
    public void testLongSerialization() throws Exception {
        final List<Long> randomInts = generateRandomLongs(1000);
        final BytesRefHash sentHash = new BytesRefHash();
        for(final Long word : randomInts) {
            sentHash.add(new BytesRef(word.toString()));
        }

        final InternalStringTermListFacet sentFacet = new InternalStringTermListFacet("foo", sentHash, Constants.FIELD_DATA_TYPE.INT);
        final InternalStringTermListFacet receivedFacet = new InternalStringTermListFacet();
        serializeAndDeserialize(sentFacet, receivedFacet);
View Full Code Here


    }

    @Test
    public void testIntSerialization() throws Exception {
        final List<Integer> randomInts = generateRandomInts(1000);
        final BytesRefHash sentHash = new BytesRefHash();
        for(final Integer word : randomInts) {
            sentHash.add(new BytesRef(word.toString()));
        }

        final InternalStringTermListFacet sentFacet = new InternalStringTermListFacet("foo", sentHash, Constants.FIELD_DATA_TYPE.INT);
        final InternalStringTermListFacet receivedFacet = new InternalStringTermListFacet();
        serializeAndDeserialize(sentFacet, receivedFacet);
View Full Code Here

    }

    @Test
    public void testStringSerialization() throws Exception {
        final List<String> randomWords = generateRandomWords(1000);
        final BytesRefHash sentHash = new BytesRefHash();
        for(final String word : randomWords) {
            sentHash.add(new BytesRef(word));
        }

        final InternalStringTermListFacet sentFacet = new InternalStringTermListFacet("foo", sentHash, Constants.FIELD_DATA_TYPE.STRING);
        final InternalStringTermListFacet receivedFacet = new InternalStringTermListFacet();
        serializeAndDeserialize(sentFacet, receivedFacet);
View Full Code Here

    private BytesRefHash _bytesRefs;

    private List<String> _strings;

    InternalStringTermListFacet() {
        _bytesRefs = new BytesRefHash();
    }
View Full Code Here

        _bytesRefs = new BytesRefHash();
    }

    InternalStringTermListFacet(final String facetName) {
        super(facetName);
        _bytesRefs = new BytesRefHash();
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.util.BytesRefHash$TrackingDirectBytesStartArray

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.