Lucene 查询的关键字和保留字

+ - & | ! ( ) { } [ ] ^ ~ * ? : \ 还有 AND OR NOT

这些关键字在查询前要进行过滤或替换或转义

否则将出现如下错误:
Exception in thread "main" org.apache.lucene.queryParser.ParseException: Cannot parse '
': Encountered "<EOF>" at line 1, column 4.
Was expecting one of:
    <NOT> ...
    "+" ...
    "-" ...
    "(" ...
    "*" ...
    <QUOTED> ...
    <TERM> ...
    <PREFIXTERM> ...
    <WILDTERM> ...
    "[" ...
    "{" ...
    <NUMBER> ...
   
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:149)

你可能感兴趣的:(java,apache,thread,Lucene)