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 Cam Bazz <ca...@gmail.com> on 2008/06/24 00:03:21 UTC

uniqueWords, and termDocs

Hello,

I need to be able to select a random word out of all the words in my index.
how can I do this tru termDocs() ?

Also, I need to get a list of unique words as well. Is there a way to ask
this to lucene?

Best Regards,
-C.B.

Re: uniqueWords, and termDocs

Posted by Erick Erickson <er...@gmail.com>.
Isn't asking for unique words (actually tokens) equivalent to enumerating
all the terms in a field?

I have no idea how to select a random word. Seems like you'd have to
somehow use a TermEnum, but I don't think there's anything built in.

Best
Erick

On Mon, Jun 23, 2008 at 6:03 PM, Cam Bazz <ca...@gmail.com> wrote:

> Hello,
>
> I need to be able to select a random word out of all the words in my index.
> how can I do this tru termDocs() ?
>
> Also, I need to get a list of unique words as well. Is there a way to ask
> this to lucene?
>
> Best Regards,
> -C.B.
>