SOLR 术语频率 [英] SOLR term frequency

查看:25
本文介绍了SOLR 术语频率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 solr,到目前为止一切都很好.当我进行搜索时,我想获取每个文档中搜索术语"的次数以及文档本身.我已经找到了很多信息,但是经过它之后,我仍然不明白如何做到这一点.有那么难吗?

I am using solr, and so far everything is going great. When I do a search, I want to get back how many times the search 'term' was per document, along with the document itself. I have found alot of information but after going trough it I still don't understand how I can do this. Is it that extreme hard ?

有人可以帮我吗?

虽然我确实得到了结果,但 fl 字段始终为 0

Altough I do get results, the fl field is always 0

http://localhost:8983/solr/collection1/select?q=text:*mySearchTerm*&fl=*,fl:termfreq(text,*mySearchTerm*)

推荐答案

好的,我发现 termfreq 不适用于 MultiValues 字段.所以我使用了一个复制字段并添加了 termVectors="true" termPositions="true" termOffsets="true".现在可以了

Ok, I found out that termfreq doesn't work for MultiValues fields. So I used a copy field and added termVectors="true" termPositions="true" termOffsets="true". Now it works

这篇关于SOLR 术语频率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆