yuuvis® RAD Q&A

+1 vote
by (210 points)

How can NULL-values be queried using ResultService.getQueryResult?

I have an objecttype "billinginfo" with a boolean-field "watermarked" that has no default-value set.
Using the result service I can query and find documents that have the field set to true or false but not the ones where the field value is not yet set.

http://localhost:8080/rest-ws/service/result/query?query=watermarked=true&type=billinginfo

Is it possible to query NULL values with ResultService.getQueryResult or do I have to use ResultService.getEsqlResult:

http://localhost:8080/rest-ws/service/result/raw?esql=select * from [dms]:[billinginfo] where watermarked = null

2 Answers

0 votes
by (19.6k points)

For now you will have to use the getEsqlResult endpoint. We know about this limitation of the getQueryResult endpoint and are working on a solution for future releases.

0 votes
by (19.2k points)
edited by

Beginning with version 4.5 you can query empty fields via Search API, as documented here:
https://developer.enaio.org/display/DD/Search Service API

"basisdocument.status": {
  "o": "eq",
  "v1": null                // for any field: This query returns documents that have no value in the named field.
},

The search for empty fields is also support by using search forms in the search dialog of the client. A click onto the field label signals search for an missing value.

Related questions

...