solr搜索查询在两个字段中应用条件(存在或不存在)

solr search query apply condition in both field (exist OR does not exist)

我有不同动态场的数据。我想在存在的字段记录中应用条件,我也不需要存在的字段记录。我的 Solr 版本 6.1.0

{"employeeid" : "220",  "displayname_s": "abu", "attr_36977": 55 },
{"employeeid" : "910",  "displayname_s": "test","attr_36400": 565 },
{"employeeid" : "210", "displayname_s": "sam"},
{"employeeid" : "64", "displayname_s": "wel", "attr_36977": 152},

我写了这样的查询

(-attrl_36977:[* TO *] OR attrl_36977:[0 TO 100])

但是这个查询不是锻炼。

空闲结果是前三个记录(220,910,210)。如何解决需求

您必须明确说明要从以下内容中减去 OR 语句第一部分的内容:

(*:* -attrl_36977:[* TO *]) OR attrl_36977:[0 TO 100]

.. 将为您提供任何在 attrl_36977 中没有值或值介于 0 和 100 之间的文档。