lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From feng lu <amuseme...@gmail.com>
Subject Re: about some seacher(I'm new hand, thank you for help)
Date Tue, 10 Jul 2012 08:24:29 GMT
hi sam

you can add content and time stamp field like this.

// add content
 doc.add(new Field("contents", content,Field.Store.NO,Field.Index.ANALYZED);
 // add timestamp
 NumericField timestampField = new NumericField("timestamp");
 timestampField.setLongValue(DateField.stringToTime(timestamp));
 doc.add(timestampField);

To perform range querying or filtering against a NumericField, use
NumericRangeQuery or NumericRangeFilter. you can see the
http://wiki.apache.org/lucene-java/SearchNumericalFields to find any useful
information.

On Tue, Jul 10, 2012 at 3:38 PM, sam <hairen512@yahoo.com.cn> wrote:

> timestamp




-- 
Don't Grow Old, Grow Up... :-)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message