SOLR词频 [英] SOLR term frequency

查看:88
本文介绍了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天全站免登陆