当前位置: 首页>>代码示例>>Java>>正文


Java StreamOutput.writeBytesRef方法代码示例

本文整理汇总了Java中org.elasticsearch.common.io.stream.StreamOutput.writeBytesRef方法的典型用法代码示例。如果您正苦于以下问题:Java StreamOutput.writeBytesRef方法的具体用法?Java StreamOutput.writeBytesRef怎么用?Java StreamOutput.writeBytesRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.io.stream.StreamOutput的用法示例。


在下文中一共展示了StreamOutput.writeBytesRef方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(final StreamOutput out) throws IOException {
    out.writeVInt(termStatistics.size());

    for (ObjectObjectCursor<Term, TermStatistics> c : termStatistics()) {
        Term term = c.key;
        out.writeString(term.field());
        out.writeBytesRef(term.bytes());
        TermStatistics stats = c.value;
        out.writeBytesRef(stats.term());
        out.writeVLong(stats.docFreq());
        out.writeVLong(DfsSearchResult.addOne(stats.totalTermFreq()));
    }

    DfsSearchResult.writeFieldStats(out, fieldStatistics);
    out.writeVLong(maxDoc);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:AggregatedDfs.java

示例2: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(final StreamOutput out) throws IOException {
    out.writeVInt(termStatistics.size());
    
    for (ObjectObjectCursor<Term, TermStatistics> c : termStatistics()) {
        Term term = (Term) c.key;
        out.writeString(term.field());
        out.writeBytesRef(term.bytes());
        TermStatistics stats = (TermStatistics) c.value;
        out.writeBytesRef(stats.term());
        out.writeVLong(stats.docFreq());
        out.writeVLong(DfsSearchResult.addOne(stats.totalTermFreq()));
    }

    DfsSearchResult.writeFieldStats(out, fieldStatistics);
    out.writeVLong(maxDoc);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:AggregatedDfs.java

示例3: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeBytesRef(termBytes);
    out.writeVLong(subsetDf);
    out.writeVLong(supersetDf);
    out.writeDouble(getSignificanceScore());
    aggregations.writeTo(out);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:SignificantStringTerms.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalString(key);
    out.writeBoolean(from != null);
    if (from != null) {
        out.writeBytesRef(from);
    }
    out.writeBoolean(to != null);
    if (to != null) {
        out.writeBytesRef(to);
    }
    out.writeLong(docCount);
    aggregations.writeTo(out);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:InternalBinaryRange.java

示例5: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(id);
    out.writeVInt(terms.length);
    for (Term term : terms) {
        out.writeString(term.field());
        out.writeBytesRef(term.bytes());
    }
    writeTermStats(out, termStatistics);
    writeFieldStats(out, fieldStatistics);
    out.writeVInt(maxDoc);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:DfsSearchResult.java

示例6: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(name);
    out.writeVLong(length);
    out.writeString(checksum);
    out.writeString(writtenBy.toString());
    out.writeBytesRef(hash);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:StoreFileMetaData.java

示例7: writeSortValue

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
private static void writeSortValue(StreamOutput out, Object field) throws IOException {
    if (field == null) {
        out.writeByte((byte) 0);
    } else {
        Class type = field.getClass();
        if (type == String.class) {
            out.writeByte((byte) 1);
            out.writeString((String) field);
        } else if (type == Integer.class) {
            out.writeByte((byte) 2);
            out.writeInt((Integer) field);
        } else if (type == Long.class) {
            out.writeByte((byte) 3);
            out.writeLong((Long) field);
        } else if (type == Float.class) {
            out.writeByte((byte) 4);
            out.writeFloat((Float) field);
        } else if (type == Double.class) {
            out.writeByte((byte) 5);
            out.writeDouble((Double) field);
        } else if (type == Byte.class) {
            out.writeByte((byte) 6);
            out.writeByte((Byte) field);
        } else if (type == Short.class) {
            out.writeByte((byte) 7);
            out.writeShort((Short) field);
        } else if (type == Boolean.class) {
            out.writeByte((byte) 8);
            out.writeBoolean((Boolean) field);
        } else if (type == BytesRef.class) {
            out.writeByte((byte) 9);
            out.writeBytesRef((BytesRef) field);
        } else {
            throw new IOException("Can't handle sort field value of type [" + type + "]");
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:38,代码来源:Lucene.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeBytesRef(termBytes);
    out.writeVLong(getDocCount());
    if (showDocCountError) {
        out.writeLong(docCountError);
    }
    aggregations.writeTo(out);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:StringTerms.java

示例9: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(name);
    out.writeVLong(length);
    out.writeOptionalString(checksum);
    out.writeOptionalString(writtenBy == null ? null : writtenBy.toString());
    out.writeBytesRef(hash);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:StoreFileMetaData.java

示例10: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeByte(percolatorTypeId);
    out.writeVLong(requestedSize);
    out.writeVLong(count);
    out.writeVInt(matches.length);
    for (BytesRef match : matches) {
        out.writeBytesRef(match);
    }
    out.writeVLong(scores.length);
    for (float score : scores) {
        out.writeFloat(score);
    }
    out.writeVInt(hls.size());
    for (Map<String, HighlightField> hl : hls) {
        out.writeVInt(hl.size());
        for (Map.Entry<String, HighlightField> entry : hl.entrySet()) {
            out.writeString(entry.getKey());
            entry.getValue().writeTo(out);
        }
    }
    out.writeOptionalStreamable(aggregations);
    if (pipelineAggregators == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeVInt(pipelineAggregators.size());
        for (PipelineAggregator pipelineAggregator : pipelineAggregators) {
            out.writeBytesReference(pipelineAggregator.type().stream());
            pipelineAggregator.writeTo(out);
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:35,代码来源:PercolateShardResponse.java

示例11: writeTermTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void writeTermTo(StreamOutput out) throws IOException {
    out.writeBytesRef(termBytes);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:StringTerms.java

示例12: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeBytesRef(type);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:TypeQueryBuilder.java

示例13: writeMinMax

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeMinMax(StreamOutput out) throws IOException {
    out.writeBytesRef(minValue);
    out.writeBytesRef(maxValue);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:FieldStats.java

示例14: writeFieldDoc

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
public static void writeFieldDoc(StreamOutput out, FieldDoc fieldDoc) throws IOException {
    out.writeVInt(fieldDoc.fields.length);
    for (Object field : fieldDoc.fields) {
        if (field == null) {
            out.writeByte((byte) 0);
        } else {
            Class type = field.getClass();
            if (type == String.class) {
                out.writeByte((byte) 1);
                out.writeString((String) field);
            } else if (type == Integer.class) {
                out.writeByte((byte) 2);
                out.writeInt((Integer) field);
            } else if (type == Long.class) {
                out.writeByte((byte) 3);
                out.writeLong((Long) field);
            } else if (type == Float.class) {
                out.writeByte((byte) 4);
                out.writeFloat((Float) field);
            } else if (type == Double.class) {
                out.writeByte((byte) 5);
                out.writeDouble((Double) field);
            } else if (type == Byte.class) {
                out.writeByte((byte) 6);
                out.writeByte((Byte) field);
            } else if (type == Short.class) {
                out.writeByte((byte) 7);
                out.writeShort((Short) field);
            } else if (type == Boolean.class) {
                out.writeByte((byte) 8);
                out.writeBoolean((Boolean) field);
            } else if (type == BytesRef.class) {
                out.writeByte((byte) 9);
                out.writeBytesRef((BytesRef) field);
            } else {
                throw new IOException("Can't handle sort field value of type [" + type + "]");
            }
        }
    }
    out.writeVInt(fieldDoc.doc);
    out.writeFloat(fieldDoc.score);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:43,代码来源:Lucene.java

示例15: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeBytesRef(minValue);
    out.writeBytesRef(maxValue);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:7,代码来源:FieldStats.java


注:本文中的org.elasticsearch.common.io.stream.StreamOutput.writeBytesRef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。