lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: To get the term-freq
Date Mon, 20 Nov 2017 18:06:12 GMT
You could use the PostingsEnum API, advance to your document, then call
freq()?

I believe there is also a function query based on the term doc freq.

Mike McCandless

http://blog.mikemccandless.com

On Fri, Nov 17, 2017 at 11:37 AM, Ahmet Arslan <iorixxx@yahoo.com.invalid>
wrote:

> Hi,
>
> I am also intersted into the answer to this question.
> I wonder whether term freq. function query would work here.
>
> Ahmet
>
>
>
>
>
> On Friday, November 17, 2017, 10:32:23 AM GMT+3, Dwaipayan Roy <
> dwaipayan.roy@gmail.com> wrote:
>
>
>
>
>
> ​Hi,
>
> I want to get the term frequency of a given term t in a given document with
> lucene docid say d.
> Formally, I need a function say f() that takes two arguments: 1.
> lucene-docid d, 2. term t, and returns the number of time t occurs in d.
>
> I know of one solution, that is, traversing the whole document using
> TermsEnum iterator, but it is taking a lot of time. I want a solution that
> works fast.
>
> Dwaipayan.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message