我正在使用solr 6.6.0,这里是集合中的文档.
{"id":1,"content":test1"}
{"id":2,"content":test2"}
{"id":3,"content":test3"}
Run Code Online (Sandbox Code Playgroud)
假设我想要包含不包含"test1"和"test2"的文档,根据引用指南的" 分组条款形式子查询"部分,以下列方式编写查询字符串似乎是合法的.
content:((NOT "test1") AND (NOT "test2"))
Run Code Online (Sandbox Code Playgroud)
查询的结果是预期仅返回文档#3,但实际结果为空.
或者,如果将上述查询更改为以下内容,如果没有括号围绕"NOT表达式",则返回预期结果.
content:(NOT "test1" AND NOT "test2")
Run Code Online (Sandbox Code Playgroud)
我的问题是,为什么第一个查询字符串不能以预期的方式工作?