2014-03-06 41 views
1

的索引結構。我首先使用「./bin/trec_setup.sh var/corpus」 其次,我使用「./bin/trec_terrier.sh -i -j」,但是出現錯誤,無法加載稱爲元的索引結構指數。當我使用小獵犬3.5爲集合建立倒排索引時,無法加載名爲元索引

Setting TERRIER_HOME to /home/mao/Desktop/terrier-3.5 
INFO - TRECCollection read collection specification (1 files) 
INFO - Processing var/collection/sogou/sogou 
INFO - Structure meta reading lookup file into memory 
INFO - Structure meta reading reverse map for key docno directly from disk 
ERROR - Couldn't load an index structure called meta 
java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
    at org.terrier.structures.Index.loadIndexStructure(Index.java:421) 
    at org.terrier.structures.Index.getIndexStructure(Index.java:330) 
    at org.terrier.structures.Index.loadIndices(Index.java:252) 
    at org.terrier.structures.Index.<init>(Index.java:189) 
    at org.terrier.structures.Index.createIndex(Index.java:659) 
    at org.terrier.applications.TRECIndexing.createSinglePass(TRECIndexing.java:204) 
    at org.terrier.applications.TrecTerrier.run(TrecTerrier.java:382) 
    at org.terrier.applications.TrecTerrier.applyOptions(TrecTerrier.java:564) 
    at org.terrier.applications.TrecTerrier.main(TrecTerrier.java:235) 
Caused by: java.io.FileNotFoundException: /home/mao/Desktop/terrier-3.5/var/index/data.meta-0.fsomapfile (No such file or directory) 
    at java.io.RandomAccessFile.open(Native Method) 
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241) 
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:122) 
    at org.terrier.utility.io.LocalFileSystem$LocalRandomAccessFile.<init>(LocalFileSystem.java:54) 
    at org.terrier.utility.io.LocalFileSystem.openFileRandom(LocalFileSystem.java:116) 
    at org.terrier.utility.Files.openFileRandom(Files.java:354) 
    at org.terrier.structures.collections.FSOrderedMapFile.<init>(FSOrderedMapFile.java:571) 
    at org.terrier.structures.CompressingMetaIndex.loadIndex(CompressingMetaIndex.java:1194) 
    at org.terrier.structures.CompressingMetaIndex.<init>(CompressingMetaIndex.java:835) 
    ... 13 more 
A problem occurred: java.lang.NullPointerException 
java.lang.NullPointerException 
    at org.terrier.applications.TRECIndexing.createSinglePass(TRECIndexing.java:205) 
    at org.terrier.applications.TrecTerrier.run(TrecTerrier.java:382) 
    at org.terrier.applications.TrecTerrier.applyOptions(TrecTerrier.java:564) 
    at org.terrier.applications.TrecTerrier.main(TrecTerrier.java:235) 
[email protected]:~/Desktop/terrier-3.5$ ./bin/trec_terrier.sh --printmeta 
Setting TERRIER_HOME to /home/mao/Desktop/terrier-3.5 
ERROR - Couldn't load an index structure called meta-inputstream 
java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
    at org.terrier.structures.Index.loadIndexStructure(Index.java:421) 
    at org.terrier.structures.Index.getIndexStructureInputStream(Index.java:449) 
    at org.terrier.structures.IndexUtil.printMetaIndex(IndexUtil.java:328) 
    at org.terrier.applications.TrecTerrier.run(TrecTerrier.java:412) 
    at org.terrier.applications.TrecTerrier.applyOptions(TrecTerrier.java:564) 
    at org.terrier.applications.TrecTerrier.main(TrecTerrier.java:235) 
Caused by: java.io.EOFException 
    at java.io.DataInputStream.readFully(DataInputStream.java:197) 
    at java.io.DataInputStream.readLong(DataInputStream.java:416) 
    at org.terrier.structures.CompressingMetaIndex$InputStream.<init>(CompressingMetaIndex.java:702) 
    at org.terrier.structures.CompressingMetaIndex$InputStream.<init>(CompressingMetaIndex.java:730) 
    ... 10 more 
A problem occurred: java.lang.NullPointerException 
java.lang.NullPointerException 
    at org.terrier.structures.IndexUtil.printMetaIndex(IndexUtil.java:329) 
    at org.terrier.applications.TrecTerrier.run(TrecTerrier.java:412) 
    at org.terrier.applications.TrecTerrier.applyOptions(TrecTerrier.java:564) 
    at org.terrier.applications.TrecTerrier.main(TrecTerrier.java:235) 

回答

0

當這發生在我身上,對錯誤的原因是,有一個腐敗指數在梗文件夾,這是創建,因爲我跑不索引首先運行安裝程序。

從Terrier主目錄中的var/index子文件夾中刪除所有文件。

然後它可以正常工作。