Examples of BytesRefHash


Examples of org.apache.lucene.util.BytesRefHash

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

Examples of org.apache.lucene.util.BytesRefHash

    }

    @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

Examples of org.apache.lucene.util.BytesRefHash

    }

    @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

Examples of org.apache.lucene.util.BytesRefHash

    private BytesRefHash _bytesRefs;

    private List<String> _strings;

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

Examples of org.apache.lucene.util.BytesRefHash

        _bytesRefs = new BytesRefHash();
    }

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

Examples of org.elasticsearch.common.util.BytesRefHash

                                 IncludeExclude includeExclude, AggregationContext aggregationContext, Aggregator parent, SubAggCollectionMode collectionMode, boolean showTermDocCountError, Map<String, Object> metaData) {

        super(name, factories, estimatedBucketCount, aggregationContext, parent, order, bucketCountThresholds, collectionMode, showTermDocCountError, metaData);
        this.valuesSource = valuesSource;
        this.includeExclude = includeExclude;
        bucketOrds = new BytesRefHash(estimatedBucketCount, aggregationContext.bigArrays());
        previous = new BytesRefBuilder();
    }
View Full Code Here

Examples of org.elasticsearch.common.util.BytesRefHash

                return new AndFilter(filters);
            } else {
                return new TermFilter(new Term(UidFieldMapper.NAME, Uid.createUidAsBytes(parentType, id)));
            }
        } else {
            BytesRefHash parentIds= null;
            boolean constructed = false;
            try {
                parentIds = new BytesRefHash(numFoundParents, searchContext.bigArrays());
                for (long parentOrd = parentOrds.nextSetBit(0); parentOrd != -1; parentOrd = parentOrds.nextSetBit(parentOrd + 1)) {
                    parentIds.add(globalValues.lookupOrd((int) parentOrd));
                }
                constructed = true;
            } finally {
                if (!constructed) {
                    Releasables.close(parentIds);
View Full Code Here

Examples of org.elasticsearch.common.util.BytesRefHash

                return new AndFilter(filters);
            } else {
                return new TermFilter(new Term(UidFieldMapper.NAME, Uid.createUidAsBytes(parentType, id)));
            }
        } else {
            BytesRefHash parentIds = null;
            boolean constructed = false;
            try {
                parentIds = new BytesRefHash(numFoundParents, searchContext.bigArrays());
                for (int id = 0; id < parentIdxs.size(); id++) {
                    parentIds.add(globalValues.lookupOrd((int) parentIdxs.get(id)));
                }
                constructed = true;
            } finally {
                if (!constructed) {
                    Releasables.close(parentIds);
View Full Code Here

Examples of org.elasticsearch.common.util.BytesRefHash

        if (needTotalTermFreq) {
            termsTotalFreqs = bigArrays.newLongArray(INITIAL_NUM_TERM_FREQS_CACHED, false);
        } else {
            termsTotalFreqs = null;
        }
        cachedTermOrds = new BytesRefHash(INITIAL_NUM_TERM_FREQS_CACHED, bigArrays);
    }
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.