regexp表面意思就是正则查询,但是如果遇到,查询条件中包含特殊的字符串, 就会发现,需要进行相应的转义处理

 

需要处理Lucene regexps即可:

 

    /**
     * 转义字符串中的特殊字符
     * 仅过滤Lucene regexps, 其他的勿用
     * @param keyword
     * @return
     */
    public static String escapeExprSpecialWord(String keyword) {
        return QueryParser.escape(keyword);
    }

 

相关文章:

  • 2022-12-23
  • 2022-02-20
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2021-06-12
  • 2021-11-18
  • 2021-11-27
猜你喜欢
  • 2021-07-08
  • 2021-05-16
  • 2022-02-03
  • 2022-12-23
  • 2022-01-30
  • 2021-06-25
相关资源
相似解决方案