Skip to Content
0
Aug 17, 2020 at 09:55 PM

SAP Hana Fuzzy Search

58 Views Last edit Aug 17, 2020 at 09:56 PM 2 rev

Hello,

Let's say I have table like below


ID COMPANYNAME
1 aktiv gesellschaft
2 aktien gesellschaft

I'd like to ask if there is any way where I could do a fuzzy search with OR like :

SELECT TO_DECIMAL(SCORE(),3,2) AS score, id, companyname
FROM companies
WHERE CONTAINS(companyname, 'aktiv OR gesellschaft')
ORDER BY score DESC, id;

and get score of 1 for both records (since both of them do contain aktiv OR gesellschaft), basically I'm interested to get score of 1.0 if any of the predicates in fuzzy search is present.