【问题标题】:Finding the most common terms in my Solr collection在我的 Solr 集合中查找最常用的术语
【发布时间】:2013-12-03 08:11:31
【问题描述】:

我需要在我的 Solr 集合中识别潜在的停用词。是否可以在我的集合中(或至少在给定的分片中)找到那些文档频率最高的词条?

【问题讨论】:

    标签: solr lucene information-retrieval stop-words


    【解决方案1】:

    是的,使用HighFreqTerms,例如:

    TermStats[] stats = HighFreqTerms.gethighFreqTerms(reader, 10, "myContentField", new HighFreqTerms.DocFreqComparator());
    for (TermStats stat : stats) {
        System.out.println(stat.termtext.utf8ToString() + ",   docfreq:" + stat.docFreq);
        //Or whatever else you want to do with them...
    }
    

    Luke 还突出显示最常用的术语。

    【讨论】:

      【解决方案2】:

      由于您已经设置了 Solr,请使用 TermsComponent 获取任何给定字段的术语频率:

      http://wiki.apache.org/solr/TermsComponent

      如果您有一个默认搜索字段(这是您复制字段的目标),它应该为您提供所有字段的频率。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-12-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-09-22
        • 1970-01-01
        • 2012-02-02
        相关资源
        最近更新 更多