發表文章

目前顯示的是有「Lucene」標籤的文章

Lucene

http://lucene.apache.org/core/3_6_1/demo.html CLASSPATH OK export CLASSPATH=/home/mac/xxxx/xxx/xxx.jar:/home/mac/yyyy/yyy/yyy.jar export CLASSPATH=/home/mac/xxxx/xxx/*:/home/mac/yyyy/yyy/* Not OK export CLASSPATH=/home/mac/xxxx/xxx/*.jar:/home/mac/yyyy/yyy/*.jar export CLASSPATH=/home/mac/xxxx/xxx/:/home/mac/yyyy/yyy/ http://lucene.apache.org/core/3_6_1/demo2.html Need to detect doc language and change to use correct analyzer. Create Index open an directory to put index files (dir) new an Analyzer (analyzer) new an IndexWriterConfig (iwc) do some settings on IndexWriterConfig use dir and iwc to new a IndexWriter (writer) add documents new a Document (doc) add several fields new a Field (pathField) Field pathField = new Field("path", file.getPath(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS); pathField.setIndexOptions(IndexOptions.DOCS_ONLY); doc.add(pathField); new a NumericField (modifiedField) NumericField modifiedField =...