我正在使用 Lucene 查询解析器 5.1.0
这些过滤器查询不起作用:
* AND {!tag=guid}guid:(*)
* && {!tag=guid}guid:(*)
* {!tag=guid}guid:(*)
它抛出
org.apache.solr.search.SyntaxError: Cannot parse 'guid:(*': Encountered \"<EOF>\" at line 1, column 7.\nWas expecting one of:\n <AND> ...\n <OR> ...\n <NOT> ...\n \"+\" ...\n \"-\" ...\n <BAREOPER> ...\n \"(\" ...\n \")\" ...\n \"*\" ...\n \"^\" ...\n <QUOTED> ...\n <TERM> ...\n <FUZZY_SLOP> ...\n <PREFIXTERM> ...\n <WILDTERM> ...\n <REGEXPTERM> ...\n \"[\" ...\n \"{\" ...\n <LPARAMS> ...\n <NUMBER> ...\n
这些过滤器查询确实有效:
* AND {!tag=guid}guid:*
* AND guid:(*)
* AND guid:*
* && {!tag=guid}guid:*
* && guid:(*)
* && guid:*
* {!tag=guid}guid:*
* guid:(*)
* guid:*
{!tag=guid}guid:(*)
{!tag=guid}guid:*
guid:(*)
guid:*
为什么前三个不起作用?它是查询解析器中的错误吗?
编辑:我发现空格也有奇怪的行为:
这确实有效:
* AND {!tag=guid}guid:"a"
这不起作用:
* AND {!tag=guid}guid:"a "