摘要: # 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 阅读全文
posted @ 2013-07-15 18:10 TianMG 阅读(488) 评论(0) 推荐(0) 编辑
摘要: # 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 阅读全文
posted @ 2013-07-15 18:09 TianMG 阅读(498) 评论(0) 推荐(0) 编辑