We have a set of JSON documents loaded into Watson Discovery Service. Some have a field (say X) for example X: MyXValue and some don't have that field at all. Can I write a query in WDS language that will return all documents in the collection that are missing the X field? Thanks, Eldad
Querying for documents that have missing / undefined fields in Watson Discovery Service
181 views Asked by Eldad Palachi At
2
There are 2 answers
0
On
Not sure about your question but I think that you can try to use the query and the filter parameter.
filter
An unranked query language search for matching documents.
Example: filter=bees
You can also check my link above to try another parameters that can be really useful for your queries with WDS.
- Check the Official Query reference from Watson Discovery Service.
No, you can't write that query. The query operators are documented at
https://console.bluemix.net/docs/services/discovery/query-operators.html#query-operators
You might think that you could use the "does not include" operator with a wildcard (
X:!*), but that doesn't return any results.If possible you should add an attribute to your documents so that you can test an attribute that is present, rather than trying to detect the absence of an attribute.