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


Java Terms.getSumTotalTermFreq方法代码示例

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


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

示例1: DirectCandidateGenerator

import org.apache.lucene.index.Terms; //导入方法依赖的package包/类
public DirectCandidateGenerator(DirectSpellChecker spellchecker, String field, SuggestMode suggestMode, IndexReader reader,
        double nonErrorLikelihood, int numCandidates, Analyzer preFilter, Analyzer postFilter, Terms terms) throws IOException {
    if (terms == null) {
        throw new IllegalArgumentException("generator field [" + field + "] doesn't exist");
    }
    this.spellchecker = spellchecker;
    this.field = field;
    this.numCandidates = numCandidates;
    this.suggestMode = suggestMode;
    this.reader = reader;
    final long dictSize = terms.getSumTotalTermFreq();
    this.useTotalTermFrequency = dictSize != -1;
    this.dictSize =  dictSize == -1 ? reader.maxDoc() : dictSize;
    this.preFilter = preFilter;
    this.postFilter = postFilter;
    this.nonErrorLikelihood = nonErrorLikelihood;
    float thresholdFrequency = spellchecker.getThresholdFrequency();
    this.frequencyPlateau = thresholdFrequency >= 1.0f ? (int) thresholdFrequency: (int)(dictSize * thresholdFrequency);
    termsEnum = terms.iterator();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:21,代码来源:DirectCandidateGenerator.java

示例2: WordScorer

import org.apache.lucene.index.Terms; //导入方法依赖的package包/类
public WordScorer(IndexReader reader, Terms terms, String field, double realWordLikelyHood, BytesRef separator) throws IOException {
    this.field = field;
    if (terms == null) {
        throw new IllegalArgumentException("Field: [" + field + "] does not exist");
    }
    this.terms = terms;
    final long vocSize = terms.getSumTotalTermFreq();
    this.vocabluarySize =  vocSize == -1 ? reader.maxDoc() : vocSize;
    this.useTotalTermFreq = vocSize != -1;
    this.numTerms = terms.size();
    this.termsEnum = new FreqTermsEnum(reader, field, !useTotalTermFreq, useTotalTermFreq, null, BigArrays.NON_RECYCLING_INSTANCE); // non recycling for now
    this.reader = reader;
    this.realWordLikelyhood = realWordLikelyHood;
    this.separator = separator;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:WordScorer.java

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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.getSumTotalTermFreq方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。