2010-04-21 137 views
1

面對慢搜索性能使用Lucene.Net(+ NHibernate.Search但沒關係)。慢Lucene.Net搜索性能

盧克工具箱概述:

  • 若干領域:33
  • 號文件:5607
  • 條款編號:101377
  • 有缺失?/Optimized ?:是(97478)/否

索引目錄是〜200Mb大。

查詢(使用org.apache.lucene.analysis.SimpleAnalyzer)

Title:lapsa~0.5 Abstract:lapsa~0.5 Content:lapsa~0.5 Location:lapsa~0.5 Author:lapsa~0.5

花費〜60000毫秒平均。


我懷疑我錯過了一些重要的東西。任何想法有什麼不對?不能這是正常的。


試圖'檢查'並'修復'它們。只好打勾Don't open IndexReader (when opening corrupted index),否則Check index tool不想出現。檢查的

結果:

BAD: missingSegments

診斷輸出:

ERROR: could not read any segments file in directory java.io.FileNotFoundException: no segments* file found in [email protected]:\Temp\Index: files: at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:655) at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:538) at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:306) at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:340) at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:319) at org.getopt.luke.Luke$6.run(Unknown Source)

試圖按Fix Index。得到這個:

ERROR during Fix Index: java.lang.NullPointerException at org.apache.lucene.index.CheckIndex.fixIndex(CheckIndex.java:781) at org.getopt.luke.Luke$7.run(Unknown Source)

+0

你試過優化嗎?它看起來像你有*很多待決刪除... – 2010-04-21 12:58:15

+0

@codeka當我按'luke->工具 - >優化索引',它說'失敗:沒有索引或索引是關閉的。 「重新打開並沒有幫助 – 2010-04-21 12:59:45

回答

2

聽起來像你有一個損壞的索引。 D:\ Temp \ Index文件夾中是否有任何文件?我認爲一定有或者搜索根本不起作用......你使用的是什麼版本的Lucene.Net?早期的版本曾經在一滴帽子的作用下破壞了索引,但後來的版本似乎在這方面好得多。

如果你不能弄明白,你可能只需要從頭開始重建索引。

0

在盧克轉到工具菜單並選擇檢查索引工具。看看你的索引是否損壞或有其他問題。

+0

它說有缺失的部分Wtf? – 2010-04-21 13:22:41

+0

你是否設法解決它? – 2010-04-22 13:08:11

0

This幫我一個。開啓自動優化。