Redian新闻
>
再请教一个lucene的问题
avatar
再请教一个lucene的问题# Java - 爪哇娇娃
t*g
1
一个单词,比如说China, 我怎么能得到这个token在一篇文章中出现过多少次呢?
avatar
t*g
2
有没有现成的api,还是要通过term,用id去比较,自己数呢?

【在 t*g 的大作中提到】
: 一个单词,比如说China, 我怎么能得到这个token在一篇文章中出现过多少次呢?
avatar
t*e
3
try Term Vector Query, and TermFreqVector.getTermFrequencies() method.
Cited from the API doc,
"Array of term frequencies. Locations of the array correspond one to one to the terms in the array obtained from getTerms method. Each location in the array contains the number of times this term occurs in the document or the document field."
avatar
t*g
4
Thanks. Will try.

to the terms in the array obtained from getTerms method. Each location in
the array contains the number of times this term occurs in the document or
the document field."

【在 t*******e 的大作中提到】
: try Term Vector Query, and TermFreqVector.getTermFrequencies() method.
: Cited from the API doc,
: "Array of term frequencies. Locations of the array correspond one to one to the terms in the array obtained from getTerms method. Each location in the array contains the number of times this term occurs in the document or the document field."

avatar
t*e
5
Watch out for the slow performance though.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。