`
星夜的遐想
  • 浏览: 182372 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

no segments* file found in org.apache.lucene.store.SimpleFSDirectory

阅读更多

建立好文件索引后,再执行搜索个过程中出现了这个异常:

org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.SimpleFSDirectory@D:\lucene\index01 lockFactory=org.apache.lucene.store.NativeFSLockFactory@26e431: files: [write.lock, _0.fdt, _0.fdx]
	at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:712)
	at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:75)
	at org.apache.lucene.index.IndexReader.open(IndexReader.java:462)
	at org.apache.lucene.index.IndexReader.open(IndexReader.java:308)
	at com.lyl.test.HelloLucene.sercher(HelloLucene.java:73)
	at com.lyl.test.TestLucene.search1(TestLucene.java:19)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)

 

单元测试过程中,创建索引读取器IndexReader的时候,抛出异常,并发现索引文件都为0kb,最终确认是索引IndexWriter写入器没有将缓存中的信息输入文件内,

 

解决方法是:写入器添加好文件索引后,关闭写入器,就ok了!

写道
if(writer !=null) writer.close();

  

 

分享到:
评论

相关推荐

    基于JAVA的搜索引擎 lucene-2.2.0

    Exception in thread "main" java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@E:\index: files: at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run...

    论文研究-Circle Segments 可视化技术应用研究 .pdf

    Circle Segments 可视化技术应用研究,程一博,胡俊,本文主要对Circle Segments可视化技术的应用做了研究。通过对比该技术在不同UCI数据集上的可视化结果,展示了其强大的可视化能力。通过

    c# 操作INI文件类

    private void TestINI_Load(object sender, System.EventArgs e) { //创建一个INIFile对象,参数为文件路径,如果不存在它会自动创建的 INIFile inf=new INIFile(@"D:\工作目录\VSPP\VSPPServer\bin\Debug\...

    c#操作ini文件

    private void TestINI_Load(object sender, System.EventArgs e) { //创建一个INIFile对象,参数为文件路径,如果不存在它会自动创建的 INIFile inf=new INIFile(@"D:\工作目录\VSPP\VSPPServer\bin\Debug\...

    MP3 Splitter & Joiner Pro v5.1+Keygen.rar

    - Supports to load audio files to split or merge in Windows Explorer directly: right-click the files (including *.cue, *. pls, *.m3u ), and select to open with MP3 Splitter & Joiner Pro in 'open with'...

    vox-5segments.pth.tar

    vox-5segments.pth.tar

    matlabtocarrecognition.rar_In the Making_matlab 车牌识别_杞︾墝瀹氫綅_车牌定位

    % segments in the result with largest area, and in case less than seven % segments were found, it attempts to recall the function, making the % separation between the already found segments clearer...

    Apache Hadoop 3.x state of the union and upgrade guidance

    Apache Hadoop YARN is the modern distributed operating system for big data applications. It morphed the Hadoop compute layer to be a common resource-management platform that can host a wide variety of...

    Python库 | decision-segments-0.1.0.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:decision-segments-0.1.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    Added TFlexFileFormat.StreamSupport property (default True), which difines, is it necessary to open file stream or give the file name only. - FIX: If the TCustomProp.Assign method calls when the ...

    Canvas撤回操作及前进功能(Javascript)

    * self.selectCanvas.getContext("2d").saveHistory(points, copy_segments, copy_rounds, copy_controlLine, * copy_selectedSegments, copy_selectedPoints); * 回撤及前进功能代码示例 * $(window).keydown...

    using-liferay-portal-6.2.pdf

    5.3 Alternative File Repository Options . . . . . . . . . . . . . . . . . . . . 119 5.4 Using External Repositories . . . . . . . . . . . . . . . . . . . . . . . . 119 5.5 Configuring the Documents ...

    greenplum-db-6.2.1-rhel7-x86_64.rpm

    The PXF_USER_IMPERSONATION, PXF_PRINCIPAL, and PXF_KEYTAB settings in the pxf-env.sh file. You can use the pxf-site.xml file to configure Kerberos and impersonation settings for your new Hadoop server...

    Nutch入门.rar

    1.4 nutch VS lucene.....2 2. nutch的安装与配置.....3 2.1 JDK的安装与配置.3 2.2 nutch的安装与配置........5 2.3 tomcat的安装与配置......5 3. nutch初体验7 3.1 爬行企业内部网....7 3.1.1 配置nutch.....

    Iczelion教程系列

    There's no more 64K segments. The memory is a large continuous space of 4 GB. That also means you don't have to play with segment registers. You can use any segment register to address any point in ...

    nutch 初学文档教材

    1.4 nutch VS lucene.....2 2. nutch的安装与配置.....3 2.1 JDK的安装与配置.3 2.2 nutch的安装与配置........5 2.3 tomcat的安装与配置......5 3. nutch初体验7 3.1 爬行企业内部网....7 3.1.1 配置nutch....7 ...

    Tricks of the Windows video Game Programming---part1

    Tricks of the Windows video Game Programming <br>PART I Windows Programming Foundations 7 1 Journey into the Abyss 9 A Little History.............................................................

    Sort Poems.cpp

    For example, the poem shown in Figure 1 is saved in two files as shown in Figure 2, provided that each file can only contain up to 4 lines. Notice that a blank line is also counted as a line in the ...

    kamon-example

    trace.segments.*.elapsed-time.upper_75Graphite 可以在 81 端口访问,为了获取容器的 ip,运行: docker inspect kamon-grafana-dashboard | grep IPAddress构建泊坞窗图像: sudo docker build -t akomar/kamon-...

    Solving PDE in C++: Numerical Methods in a Unified Object-Oriented Approach

    ThisbookteachesC++... The code segments and their detailed explanations show how easy it is to implement advanced algorithms such as finite elements and multigrid.

Global site tag (gtag.js) - Google Analytics