cancel
Showing results for 
Search instead for 
Did you mean: 

BTP CAPM - $search fuzzy threshold in Nodejs

sreehari_vpillai
Active Contributor
0 Kudos
268

I use $search functionality in my CAP project. I have turned on fuzzy search index on few text fields in my entity . Also , When I analyzed the generated SQL query , I could see that the fuzzy index is always 0.7 

 

##Generated Query snippet 

(CASE
				WHEN SCORE('My Search Term' IN (BusinessPartners.ID, BusinessPartners.EMAIL, BusinessPartners.FULL_NAME) FUZZY MINIMAL TOKEN SCORE 0.7 SIMILARITY CALCULATION MODE 'search') > 0 THEN TRUE
				ELSE FALSE
			END) = TRUE

 

I see that this 0.7 cannot be overridden in nodejs ( and is only supported in JAVA ) . 

Question : Is there any option to capture the query string manually and do this search programmatically ? ( I assume req._queryOptions 

or , Can I incerease the fuzzy score threshold to 0.9 using any annotations or configurations ? I see that 
@Search.fuzzinessThreshold ,  @Search.ranking is omitted in runtime. Thoughts ? 

View Entire Topic
lars_lutz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi sreehari_vpillai,
the only thing you can currently do is to capture the cqn in a custom handler or sending the sql all by yourself (not recommended).
But i created a BLI in order to discuss this feature request with my team.

Best regards,
Lars Lutz

sreehari_vpillai
Active Contributor
0 Kudos
0.7 iss too low for a fuzzy search , especially when I don't have a control over it. So , second best is to write one on my own. I enabled fuzzy for all my master data entities . By the way, its not just fuzzy index. All related annotations are omitted while the query is generated. Glad that you are taking this up internally,