當前位置: 首頁>>代碼示例>>Java>>正文


Java Terms.getSumDocFreq方法代碼示例

本文整理匯總了Java中org.apache.lucene.index.Terms.getSumDocFreq方法的典型用法代碼示例。如果您正苦於以下問題:Java Terms.getSumDocFreq方法的具體用法?Java Terms.getSumDocFreq怎麽用?Java Terms.getSumDocFreq使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.lucene.index.Terms的用法示例。


在下文中一共展示了Terms.getSumDocFreq方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: estimateStringFieldData

import org.apache.lucene.index.Terms; //導入方法依賴的package包/類
/**
 * @return the estimate for loading the entire term set into field data, or 0 if unavailable
 */
public long estimateStringFieldData() {
    try {
        LeafReader reader = context.reader();
        Terms terms = reader.terms(getFieldName());

        Fields fields = reader.fields();
        final Terms fieldTerms = fields.terms(getFieldName());

        if (fieldTerms instanceof FieldReader) {
            final Stats stats = ((FieldReader) fieldTerms).getStats();
            long totalTermBytes = stats.totalTermBytes;
            if (logger.isTraceEnabled()) {
                logger.trace("totalTermBytes: {}, terms.size(): {}, terms.getSumDocFreq(): {}",
                        totalTermBytes, terms.size(), terms.getSumDocFreq());
            }
            long totalBytes = totalTermBytes + (2 * terms.size()) + (4 * terms.getSumDocFreq());
            return totalBytes;
        }
    } catch (Exception e) {
        logger.warn("Unable to estimate memory overhead", e);
    }
    return 0;
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:27,代碼來源:PagedBytesIndexFieldData.java

示例2: writeFieldStatistics

import org.apache.lucene.index.Terms; //導入方法依賴的package包/類
private void writeFieldStatistics(Terms topLevelTerms) throws IOException {
    long sttf = topLevelTerms.getSumTotalTermFreq();
    assert (sttf >= -1);
    writePotentiallyNegativeVLong(sttf);
    long sdf = topLevelTerms.getSumDocFreq();
    assert (sdf >= -1);
    writePotentiallyNegativeVLong(sdf);
    int dc = topLevelTerms.getDocCount();
    assert (dc >= -1);
    writePotentiallyNegativeVInt(dc);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:TermVectorsWriter.java

示例3: stats

import org.apache.lucene.index.Terms; //導入方法依賴的package包/類
@Override
public FieldStats stats(Terms terms, int maxDoc) throws IOException {
    long minValue = NumericUtils.getMinLong(terms);
    long maxValue = NumericUtils.getMaxLong(terms);
    return new FieldStats.Date(
        maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(), minValue, maxValue, dateTimeFormatter()
    );
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:9,代碼來源:DateFieldMapper.java

示例4: stats

import org.apache.lucene.index.Terms; //導入方法依賴的package包/類
@Override
public FieldStats stats(Terms terms, int maxDoc) throws IOException {
    long minValue = NumericUtils.getMinInt(terms);
    long maxValue = NumericUtils.getMaxInt(terms);
    return new FieldStats.Long(
        maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(), minValue, maxValue
    );
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:9,代碼來源:ShortFieldMapper.java

示例5: stats

import org.apache.lucene.index.Terms; //導入方法依賴的package包/類
@Override
public FieldStats stats(Terms terms, int maxDoc) throws IOException {
    float minValue = NumericUtils.sortableIntToFloat(NumericUtils.getMinInt(terms));
    float maxValue = NumericUtils.sortableIntToFloat(NumericUtils.getMaxInt(terms));
    return new FieldStats.Float(
        maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(), minValue, maxValue
    );
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:9,代碼來源:FloatFieldMapper.java

示例6: stats

import org.apache.lucene.index.Terms; //導入方法依賴的package包/類
@Override
public FieldStats stats(Terms terms, int maxDoc) throws IOException {
    double minValue = NumericUtils.sortableLongToDouble(NumericUtils.getMinLong(terms));
    double maxValue = NumericUtils.sortableLongToDouble(NumericUtils.getMaxLong(terms));
    return new FieldStats.Double(
        maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(), minValue, maxValue
    );
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:9,代碼來源:DoubleFieldMapper.java

示例7: stats

import org.apache.lucene.index.Terms; //導入方法依賴的package包/類
@Override
public FieldStats stats(Terms terms, int maxDoc) throws IOException {
    long minValue = NumericUtils.getMinLong(terms);
    long maxValue = NumericUtils.getMaxLong(terms);
    return new FieldStats.Long(
        maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(), minValue, maxValue
    );
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:9,代碼來源:LongFieldMapper.java

示例8: stats

import org.apache.lucene.index.Terms; //導入方法依賴的package包/類
/**
 * @return a {@link FieldStats} instance that maps to the type of this field based on the provided {@link Terms} instance.
 */
public FieldStats stats(Terms terms, int maxDoc) throws IOException {
    return new FieldStats.Text(
        maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(), terms.getMin(), terms.getMax()
    );
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:9,代碼來源:MappedFieldType.java


注:本文中的org.apache.lucene.index.Terms.getSumDocFreq方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。