我的tomcat工程建在:d:\eclipse\workspace\luc,索引文件是d:\eclipse\workspace\luc\public\index,建立索引的時候路徑為"luc\\public\\index",但在搜索的時候,我用
searcher = new IndexSearcher(“luc\\public\\index”);
報錯了,因為lucene在FSDirectory里將我的路徑給new File(file.getCanonicalPath());
但奇怪的是file.getCanonicalPath()出來路徑不對呀
錯誤是
java.io.IOException: D:\eclipse\luc\public\index not a directory
應該是d:\eclipse\workspace\luc\public\index 才對的
郁悶很久了,現在還沒辦法解決!!!!!!!!!!!!!!!!!!!!!!!!!!