1、统计单词在某个字段出现的频率次数

    term frequency实现使用了function query.

    例如统计‘公司’这个关键字在text这个字段中出现的次数
    在返回的时候进行计算统计,即在返回参数fl中设置为fl=id,freq:termfreq(text,'公司')

    

    http://localhost:8983/solr/test/select?fl=id,freq:termfreq(text,'公司')&indent=on&q=*:*&wt=json

    

    对于多个term的Or查询,用sum进行统计,termfreq不支持phrase的统计。 
     freq:sum(termfreq(text,'中国'),termfreq(text,'公司'))

    

    http://localhost:8983/solr/test/select?fl=freq:sum(termfreq(text,'中国'),termfreq(text,'公司'))&indent=on&q=*:*&wt=json

solr 统计频率(term frequency)的更多相关文章

  1. TF-IDF(term frequency–inverse document frequency)

    TF-IDF是一种统计方法,用以评估一字词对于一个文件集或一个语料库中的其中一份文件的重要程度. 字词的重要性随着它在文件中出现的次数成正比增加,但同时会随着它在语料库中出现的频率成反比下降. TF- ...

  2. TF/IDF(term frequency/inverse document frequency)

    TF/IDF(term frequency/inverse document frequency) 的概念被公认为信息检索中最重要的发明. 一. TF/IDF描述单个term与特定document的相 ...

  3. term frequency–inverse document frequency

    term frequency–inverse document frequency

  4. ES搜索排序,文档相关度评分介绍——TF-IDF—term frequency, inverse document frequency, and field-length norm—are calculated and stored at index time.

    Theory Behind Relevance Scoring Lucene (and thus Elasticsearch) uses the Boolean model to find match ...

  5. [Bash]LeetCode192. 统计词频 | Word Frequency

    Write a bash script to calculate the frequency of each word in a text file words.txt. For simplicity ...

  6. solr统计只返回10或者100个数据的解决办法

    因为我所在的公司为政府做的项目[风险管理系统],其中涉及大量的统计展示,多数以整个市的区划,行业部门等方式返回,在昨天,我发现听过填报单位的方式返回时,始终只有100个数据.通过对比发现,在前辈的代码 ...

  7. RFC2544学习频率“Learning Frequency”详解—信而泰网络测试仪实操

    在RFC2544中, 会有一个Learning Frequency的字段让我们选择, 其值有4个, 分别是learn once, learn Every Trial, Learn Every Fram ...

  8. 统计频率(map映照容器的使用)

    问题描述  AOA非常喜欢阅读莎士比亚的诗,莎士比亚的诗中有种无形的魅力吸引着他!他认为莎士比亚的诗中之所以些的如此传神,应该是他的构词非常好!所以AOA想知道,在莎士比亚的书中,每个单词出现的频率各 ...

  9. solr 统计中stats的一般用法

    //统计数据 根据查询条件 public String getStats(String ipName) { JSONObject obj; JSONArray pageArray = new JSON ...

随机推荐

  1. algorithm ch2 Merge_sort

    这是用分治法来对序列进行排序,将较长的一个序列分解为n个比较短的序列,然后分别处理这n个较小的段序列,最后合并.使用递归的来实现. 具体实现的代码如下: void MergeSort(int *A, ...

  2. linux USB HOST之EHCI和OHCI【转】

    转自:http://blog.csdn.net/ljzcom/article/details/8186914 版权声明:本文为博主原创文章,未经博主允许不得转载.   目录(?)[-] 2 关键数据结 ...

  3. 同源、同源策略、跨域问题、django解决方案

    什么是同源: URL由协议.域名.端口和路径组成,如果两个URL的协议.域名和端口相同,则表示他们同源. 注意:假如你的网站ip是123.123.123.123,网站的域名是www.abc.com. ...

  4. 《Java编程思想》笔记 第十四章 类型信息

    1.RTTI:在运行时识别一个对象类型 JAVA在运行时 有时要 识别对象和类的信息这个机制叫RTTI.Java提供了两种机制去做这件事.传统的RTTI 和 反射. 传统的RTTI  假定编译时就已经 ...

  5. getRequestDispatcher

    request.getRequestDispatcher("/xx/xx.jsp").forward( request, response); http://blog.csdn.n ...

  6. java的maven项目(三)私服的搭建(windows版)

    1       私服 nexus 安装nexus 启动服务 启动失败的解决方法: 登录nexus 用户名/密码  admin/admin123 仓库类型 Virtual   虚拟仓库 Proxy  代 ...

  7. poj 2242(已知三点求外接圆周长)

    The Circumference of the Circle Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8310   ...

  8. 基于tinkphp3.2获取openid

    <?php namespace Home\Controller; use Think\Controller; /** * 基础 */ class BaseController extends C ...

  9. vs2012将项目同步到github

    http://www.cnblogs.com/SmallZL/p/3637613.html 大神作品,亲测可用

  10. POJ1751 Highways(Prim)

    Highways Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 13182   Accepted: 3814   Speci ...