on 2024 Jan 11 4:31 PM
In a UI5 app some filters are set like
new oFilter("lastName", oFilterOperator.Contains, oParams.name),
new oFilter("firstName", oFilterOperator.Contains, oParams.name),
new oFilter("companyName", oFilterOperator.Contains, oParams.name)
In the cds entity fuzzy search is enabled on database level like
@sql.append: 'FUZZY SEARCH INDEX ON'
firstName : String default '';
@sql.append: 'FUZZY SEARCH INDEX ON'
lastName : String default '';
@sql.append: 'FUZZY SEARCH INDEX ON'
companyName : String default '';
SELECT * FROM Dummy where CONTAINS(lastName, 'Companie', FUZZY (0.8))
Request clarification before answering.
Hello Sander,
In case of SAP CAPM, the fuzzy search has to be implemented at the service level by altering the req object.
Do not see an option to send the filter parameter for fuzzy search from UI5 and this has been achieved by implementing the custom logic at the service layer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another solution is like the one below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using hana DB, When i use the following with OR it doesn't work:
query = cds.parse.cql(`SELECT * from Dummy WHERE CONTAINS(companyName, '${sSearch}', FUZZY (0.8)) OR CONTAINS(firstName, '${sSearch}', FUZZY (0.8)) OR CONTAINS(lastName, '${sSearch}', FUZZY (0.8))`);
But the interesting thing is that it works with AND i.e. returns the entity that has the value in both columns. Any ideas why it isn't working with OR.
User | Count |
---|---|
86 | |
9 | |
9 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.