Anto Subash Anto Subash - 1 year ago 118
reST (reStructuredText) Question

Sensenet length filter Not working

I want to query the Field which are empty and which are not empty using Sensenet Odata Rest API. Their documentation mentions a filter function called 'length'. I have tried to query the field with the length operation but it fails with the error.

This is the filter I have used

$filter=length(Name) eq 2



"code": "NotSpecified",
"exceptiontype": "SnNotSupportedException",
"message": {
"lang": "en-us",
"value": "Unknown method: length"

Wiki Link

Answer Source

The length operation was included in the list of supported methods incorrectly, we apologise for that. SenseNet compiles these filters to Lucene queries and it is not possible to compose such a query in Lucene that performs an operation on a field.

(the remaining methods, like substringof or startswith can be compiled to a wildcard expression easily, so that should work)

Unfortunately 'empty' expressions are also not supported by Lucene, because of their document/term structure. So the following expression does not work either:

Description eq ''
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download