On Dec 12, 2005, at 8:10 AM, Ravi wrote:
I am trying to add some fields to lucene and I heard that adding int values are going to give much faster retrieval than adding to String values. So I
want to add int values to document . But



document.add(Field.Text("Candidate", objResultSet.getString ("ROW_ID")));

document.add(Field.Keyword("lastmodified",
objResultSet.getDate("MODIFIED_ON")));

document.add(Field.Text("days",days) );

document.add(Field.Text("contents", objReader));





Days are int but it is giving error . Please suggest me with the steps to
add and search those integer fields


All stored field data in a Lucene index are Strings. The performance difference you may be referring to is with sorting results, not in retrieval.

You will want to simply convert your int "days" into a String (Integer.toString(days) will do the trick. Careful with your analyzer if you really do want days to be searchable/sortable. Using Field.Keyword() is probably more appropriate.

        Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to