It seems like there is a bug with substringof
operator in REST/OData web service implementation.
Symptoms
When applying substringof
operator to a list items using the following syntax:
/_api/web/lists/getbytitle('Contacts')/items?$filter=substringof('John', Title) eq false
an error occurs:
<m:error
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-1, Microsoft.SharePoint.SPException</m:code>
<m:message xml:lang="en-US">The query is not valid.</m:message>
</m:error>
Workaround
You could target the listdata.svc
where substringof operator could be applied successfully.
Example:
/_vti_bin/listdata.svc/Contacts?$filter=substringof('Jane',LastName) eq false