We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is some solution to search inside field. I.e. we have:
"text": "some TEST here"
We want to get search by text TEST.
TEST
new $odata.Func('startswith','Text', 'TEST') will return empty, because test inside string (not on the start). Solution:
new $odata.Func('startswith','Text', 'TEST')
test
Set our search field to lowercase: var lowerFilter = new $odata.Func('tolower', 'Text');
var lowerFilter = new $odata.Func('tolower', 'Text');
Create new function to get index of out search text: var filterDataIndex = new $odata.Func('indexof', lowerFilter, 'TEST'.toLowerCase());
var filterDataIndex = new $odata.Func('indexof', lowerFilter, 'TEST'.toLowerCase());
Create new predicate, with filter param (ge 0): var resultFilter = new $odata.Predicate(filterDataIndex, '>=', 0);
var resultFilter = new $odata.Predicate(filterDataIndex, '>=', 0);
Create combination with predicates: var combination = $odata.Predicate.or([resultFilter]);
var combination = $odata.Predicate.or([resultFilter]);
Send query and get data: service.filter(combination).query(success)
service.filter(combination).query(success)
The text was updated successfully, but these errors were encountered:
Thanks! That may help.
Sorry, something went wrong.
No branches or pull requests
Here is some solution to search inside field. I.e. we have:
"text": "some TEST here"
We want to get search by text
TEST
.new $odata.Func('startswith','Text', 'TEST')
will return empty, becausetest
inside string (not on the start). Solution:Set our search field to lowercase:
var lowerFilter = new $odata.Func('tolower', 'Text');
Create new function to get index of out search text:
var filterDataIndex = new $odata.Func('indexof', lowerFilter, 'TEST'.toLowerCase());
Create new predicate, with filter param (ge 0):
var resultFilter = new $odata.Predicate(filterDataIndex, '>=', 0);
Create combination with predicates:
var combination = $odata.Predicate.or([resultFilter]);
Send query and get data:
service.filter(combination).query(success)
The text was updated successfully, but these errors were encountered: