lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: All keys for a field
Date Thu, 21 Jun 2007 16:28:40 GMT
You could also just use TermEnum, something like

        TermEnum termEnum = this.reader.getIndexReader().terms(new
Term(field, ""));

        Term term = termEnum.term();

        while ((term != null) && term.field().equals(field)) {
            System.out.println(term.text());
            termEnum.next();
            term = termEnum.term();
        }


On 6/21/07, Martin Spamer <mspamer@ebuyer.com> wrote:
>
>
> I need to return all of the keys for a certain field, essentially
> "fieldName:*".    This causes a ParseException / lexical error
> Encountered: "*" (42), after : ""
>
> I understand why this fails, WildCard prevent this to keep the results
> manageble.  In my case the number of results will always be managable.
> the field contents is a closed set of values from a DB lookup table.
>
> Luke can list the top keys via it's Overview tab, so this must be
> possible.  I just can't figure out how.
>
> I've tried googling but I'm just getting general stuff on wildcards, I
> can't find the correct search terms to use.
>
>
>
>
> ---------------------------------------------------------------------
> 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