lucene7.3 使用报org.apache.lucene.queryparser.classic.ParseException错误

原创 2018年04月17日 13:55:32

搜索代码

运行时出现如下异常

org.apache.lucene.queryparser.classic.ParseException: Encountered "<EOF>" at line 1, column 0.
Was expecting one of:
    <NOT> ...
    "+" ...
    "-" ...
    <BAREOPER> ...
    "(" ...
    "*" ...
    <QUOTED> ...
    <TERM> ...
    <PREFIXTERM> ...
    <WILDTERM> ...
    <REGEXPTERM> ...
    "[" ...
    "{" ...
    <NUMBER> ...
    <TERM> ...
    
at org.apache.lucene.queryparser.classic.QueryParser.generateParseException(QueryParser.java:931)
at org.apache.lucene.queryparser.classic.QueryParser.jj_consume_token(QueryParser.java:813)
at org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:252)
at com.qhcccy.lucene.SearchIndex.searchIndex(SearchIndex.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:513)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:113)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:58)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:113)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:121)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:121)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:121)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:121)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:55)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:65)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

解决办法:

改成

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huaquan520/article/details/79973793

周哥跟你谈谈网页布局容易犯的错误

-
  • 1970年01月01日 08:00

lucene3.5报错org.apache.lucene.queryParser.ParseException

org.apache.lucene.queryParser.ParseException: Encountered "" at line 1, column 0. Was expecting one...
  • luyee2010
  • luyee2010
  • 2013-01-18 15:52:31
  • 4099

Lucene 7 入门案例

1 开发准备:jdk 1.8        所需jar包:            commons-io-2.6.jar,            lucene-analyzers-common-7.2....
  • qq_36470908
  • qq_36470908
  • 2018-03-20 16:57:00
  • 100

springmvc4中responseBody使用报406错误

要在pom中 添加两个jar包 com.fasterxml.jackson.core jackson-databind 2.5.4 ...
  • chenyidong521
  • chenyidong521
  • 2017-04-07 17:31:22
  • 275

linux下python使用报ssl验证错误

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) 解决办法:关掉验证 ss...
  • lijjianqing
  • lijjianqing
  • 2017-02-04 15:11:40
  • 591

使用sqlldr 遇到的问题

错误代码:SQL*Loader-457: Comparison text of CONTINUEIF LAST must have length 1 not 63 先到http://docs.orac...
  • q12344566789
  • q12344566789
  • 2016-03-03 15:36:11
  • 328

主板故障检测卡代码查询使用报警声含义查询

  • 2014年03月13日 14:13
  • 75KB
  • 下载

Lucene之高亮显示-yellowcong

高亮显示,在WEB的查询和检索中,会经常的用到,我们需要通过高亮的操作来显示关键字。操作的时候,将高亮的数据处理后,封装成对象后,再返回给调用者。...
  • yelllowcong
  • yelllowcong
  • 2017-12-03 22:14:26
  • 134

SecureCRT&FX 7.2.1(最新版附带注册机)

  • 2014年03月06日 14:16
  • 40.9MB
  • 下载

在子查询中使用 order by 总是告错:ORA-00907: missing right parenth.解决办法!

在子查询中使用 order by 总是告错.谁知道解决办法? oracle   8.0版本,在子查询中使用   order   by   总是告错.  例如需要从学生信息表中提取分数列前5名的学生...
  • qq_21399933
  • qq_21399933
  • 2017-10-11 17:27:58
  • 188
收藏助手
不良信息举报
您举报文章:lucene7.3 使用报org.apache.lucene.queryparser.classic.ParseException错误
举报原因:
原因补充:

(最多只允许输入30个字)