Hi,

I've used NumericField to store my "hour" field.

Example...

     doc.add(new NumericField("hour").setIntValue(Integer.parseInt("12")));

Before I was using plain string Field and enumerating them with
TermEnum, which worked fine.
Now I'm using NumericField's I'm not sure how to port this enumeration code.

Any pointers?

This is the code I was using previously for plain Fields.

    ArrayList hours = new ArrayList();
    TermEnum termEnum = reader.terms( new Term( "hour", "" ) );
    Term term = null;
    while ( ( term = termEnum.term() ) != null ) {
        
        if ( ! term.field().equals( "hour" ) )
            break;
        
        hours.add( (Integer)term.text() );
        termEnum.next();        
    }

Thanks,
Phil

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

Reply via email to