Anto Subash Anto Subash - 1 month ago 20
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


Sense/Net 6.5.4.9496

Exception

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


Wiki Link http://wiki.sensenet.com/OData_REST_API

Answer

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 ''
Comments