摘要:
# coding: utf-8import luceneindexDir = './index'query = 'zhongguo'lucene.initVM()print 'lucene', lucene.VERSION#索引的存放位置indir = lucene.SimpleFSDirectory(lucene.File(indexDir))#分词器analyzer = lucene.StandardAnalyzer(lucene.Version.LUCENE_CURRENT)#检索器searcher = lucene.IndexSearch 阅读全文
摘要:
# coding:utf-8'''对doc目录里的所有文件建立索引,索引域主要有name,path,contents'''import sys, osimport lucenefrom lucene import SimpleFSDirectory,Document,File, Field,\ StandardAnalyzer, IndexWriter, Versionfrom datetime import datetimelucene.initVM() ############1print 'lucene',lucene.VE 阅读全文