Skip to Content
avatar image
Former Member

SAP HANA CDS Fuzzy Search not working

I have a hdbdd defined as below, but the fuzzy search i tried using this search query as doesn't works.

https://xxxxxxxx.xxx.xx.xxxxx.com/xxxxx.xsodata/LandValue?$format=json&search=singaporw

Only maps to full text. E.g. "singapore" instead of "singaporw" or "sing"

namespace xxx;
@Schema : 'XXX'

context fuzzysearch {

    @Catalog.tableType : #COLUMN
    entity ADDRESS {
        key id  : Integer;
        street  : String(80);
        zipCode : Integer;
        city    : String(80);

        @SearchIndex.text.enabled   : true
        @SearchIndex.fuzzy.enabled  : true
        country : String(80);

    };

    @Search.searchable: true  
    define view V_ADDRESS as select from ADDRESS as ADDRESS {  
        @EnterpriseSearch.key : true  
        ADDRESS.id,  

        @Search.defaultSearchElement: true  
        @Search.ranking: #HIGH  
        @Search.fuzzinessThreshold : 0.7
        ADDRESS.country 
    };  
};
Add comment
10|10000 characters needed characters exceeded

  • Just tried that with SP12 and it seems to me that the search against the entity is always executed with fuzzinessThreshold=1.

    So, maybe it would be an option to just expose the view? With that approach even partial matches were returned in my test.

  • Get RSS Feed

0 Answers