1
import sys, os
import lucene
from java.io import File
from org.apache.lucene.analysis.standard import StandardAnalyzer
from org.apache.lucene.index import DirectoryReader
from org.apache.lucene.queryparser.classic import QueryParser
from org.apache.lucene.document import Document, Field
from org.apache.lucene.index import IndexWriter, IndexWriterConfig
from org.apache.lucene.store import SimpleFSDirectory
from org.apache.lucene.util import Version
def index(start, no, dom):
lucene.initVM()
# join base dir and index dir
path = raw_input("Path for index: ")
index_path = File(path)
directory = SimpleFSDirectory(index_path) # the index
我一直有與SimpleFSDirectory錯誤,甚至當我嘗試過其他的東西像目錄= SimpleFSDirectory(文件(os.path.abspath則( 「路徑」)))SimpleFSDirectory不是蟒蛇Lucene的工作
InvalidArgsError :( '初始化',(,))