问题描述:

I want to return documents that either have a specific field missing or that same field has a specific value.

The following does not work:

.Filter(bf =>

bf.Missing(m => m.Name(Field1))

|| bf.Term(Field1, "Value")

I expect to get documents returned that:

  • Do not contain Field1
  • And documents that do have Field1 but have the specific value "Value"

The above code returns documents where Field1=="Value"

but does not return documents where Field1 is missing.

相关阅读:
Top