1
在以前版本的Lucene的,一個可以這樣做:的Lucene 5.3如何日期添加到您的領域
Document doc = new Document();
doc.add(new Field("file_modified",
DateTools.timeToString(file.lastModified(), DateTools.Resolution.MINUTE),
Field.Store.YES, Field.Index.NOT_ANALYZED));
,並存儲該文件的修改日期(這樣以後就可以通過日期搜索) 。目前,我正在使用lucene 5.3,並不知道如何做到這一點?上面的代碼已被棄用(不多new Field
也不Field.Index.NOT_ANALYZED)
使用[StringField](https://lucene.apache.org/core /5_3_1/core/org/apache/lucene/document/StringField.html),請參閱[4.0遷移指南](https://lucene.apache.org/core/4_0_0/MIGRATE.html) – femtoRgon
@femtoRgon謝謝,非常感謝有幫助! – adhg