solr 统计频率(term frequency)
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)的更多相关文章
- TF-IDF(term frequency–inverse document frequency)
TF-IDF是一种统计方法,用以评估一字词对于一个文件集或一个语料库中的其中一份文件的重要程度. 字词的重要性随着它在文件中出现的次数成正比增加,但同时会随着它在语料库中出现的频率成反比下降. TF- ...
- TF/IDF(term frequency/inverse document frequency)
TF/IDF(term frequency/inverse document frequency) 的概念被公认为信息检索中最重要的发明. 一. TF/IDF描述单个term与特定document的相 ...
- term frequency–inverse document frequency
term frequency–inverse document frequency
- 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 ...
- [Bash]LeetCode192. 统计词频 | Word Frequency
Write a bash script to calculate the frequency of each word in a text file words.txt. For simplicity ...
- solr统计只返回10或者100个数据的解决办法
因为我所在的公司为政府做的项目[风险管理系统],其中涉及大量的统计展示,多数以整个市的区划,行业部门等方式返回,在昨天,我发现听过填报单位的方式返回时,始终只有100个数据.通过对比发现,在前辈的代码 ...
- RFC2544学习频率“Learning Frequency”详解—信而泰网络测试仪实操
在RFC2544中, 会有一个Learning Frequency的字段让我们选择, 其值有4个, 分别是learn once, learn Every Trial, Learn Every Fram ...
- 统计频率(map映照容器的使用)
问题描述 AOA非常喜欢阅读莎士比亚的诗,莎士比亚的诗中有种无形的魅力吸引着他!他认为莎士比亚的诗中之所以些的如此传神,应该是他的构词非常好!所以AOA想知道,在莎士比亚的书中,每个单词出现的频率各 ...
- solr 统计中stats的一般用法
//统计数据 根据查询条件 public String getStats(String ipName) { JSONObject obj; JSONArray pageArray = new JSON ...
随机推荐
- linux基础之nginx和nfs服务
第一部分: 一.nginx服务安装nginx包(源码安装)1.先cd /etc/yum.repos.d目录下2.yum install epel-release -y(安装扩展包)3.yum in ...
- 【bzoj4636】蒟蒻的数列
由于数据范围过大,直接线段树会炸,离散化或者动态开点都行. 打个标记在树上,最后把树dfs一边算一下即可. #include<bits/stdc++.h> #define N 100000 ...
- Ajax提交数据的data序列化数据提交即可
jQuery.ajax({ url: "<s:url value="/contractinfo/finanContractInfoMgrAction!saveOrMod.ac ...
- BAT 前端开发面经 —— 吐血总结
更好阅读,请移步这里 聊之前 最近暑期实习招聘已经开始,个人目前参加了阿里的内推及腾讯和百度的实习生招聘,在此总结一下 一是备忘.总结提升,二是希望给大家一些参考 其他面试及基础相关可以参考其他博文: ...
- USACO 2012 Feb Cow Coupons
2590: [Usaco2012 Feb]Cow Coupons Time Limit: 10 Sec Memory Limit: 128 MB Submit: 349 Solved: 181 [Su ...
- Redis Hlen 命令用于获取哈希表中字段的数量
http://www.runoob.com/redis/hashes-hlen.html
- tushare 安装
1.pip install lxml 2.pip install pandas 3.pip install requests 4.pip install lxml 5.pip install tush ...
- 从1到整数n中1出现的次数
题目:输入一个整数n,求从1到n这n个整数的十进制表示中1出现的次数.例如输入12,从1到12这些整数中包含1的数字有1,10,11和12共出现了5次. 不考虑时间效率的解法: int Numbe ...
- Qimage与IplImage的转换
QImage test2012::ImageCV2Qimg(IplImage* img){ assert(img!=NULL); int h = img->height; int w = img ...
- HDU 2660 Accepted Necklace【数值型DFS】
Accepted Necklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others ...