You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Weiming Yin <yi...@gmail.com> on 2006/09/23 13:44:54 UTC

Can I get the most hot term ?

Hi, all,
I am working with the follow situation.
1: a, b
2: b, c

When I build index with 1 and 2, it gives me three terms, a, b and c.
and 'b' is the most hot because it appears two times.

Is there a method that I get all (or a part of) terms that sorted by appears
time.
For the before example, when I get the terms it returns me
b (2 times), a (1 time), c( 1time).

Is there a method do like this?

Thanks.

-- 
Weiming

Re: Can I get the most hot term ?

Posted by Chris Hostetter <ho...@fucit.org>.
: I'm pretty sure you have to count them yourself, but that's made pretty easy
: by the TermEnum, TermFreqVector etc. classes. I have only used a few of
: these, so I can't be much help. But these sure seem like what you're looking
: for.

TermEnum has a docFreq member .. so you can iterate over it and record the
terms with the N highest docFreq using something like a PriorityQueue





-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Can I get the most hot term ?

Posted by Erick Erickson <er...@gmail.com>.
I'm pretty sure you have to count them yourself, but that's made pretty easy
by the TermEnum, TermFreqVector etc. classes. I have only used a few of
these, so I can't be much help. But these sure seem like what you're looking
for.

Best
Erick

On 9/23/06, Weiming Yin <yi...@gmail.com> wrote:
>
> Hi, all,
> I am working with the follow situation.
> 1: a, b
> 2: b, c
>
> When I build index with 1 and 2, it gives me three terms, a, b and c.
> and 'b' is the most hot because it appears two times.
>
> Is there a method that I get all (or a part of) terms that sorted by
> appears
> time.
> For the before example, when I get the terms it returns me
> b (2 times), a (1 time), c( 1time).
>
> Is there a method do like this?
>
> Thanks.
>
> --
> Weiming
>
>