标签:Lucene style class blog code java
Field field = new Field("filename", f.getName(), Field.Store.YES, Field.Index.NOT_ANALYZED); Field field = new Field("contents", new FileReader(f)); Field field = new Field("fullpath", f.getCanonicalPath(), Field.Store.YES, Field.Index.NOT_ANALYZED)Filed的四个参数分别代表:
Field field = new StringField("path", filetoIndex.getPath(),Field.Store.YES); Field field = new LongField("modified", filetoIndex.lastModified(),Field.Store.NO); Field field = new TextField("contents", new FileReader(filetoIndex));
【Lucene4.8教程之二】域(Field)的用法,布布扣,bubuko.com
标签:Lucene style class blog code java
原文地址:http://blog.csdn.net/jediael_lu/article/details/31353995