cancel
Showing results for 
Search instead for 
Did you mean: 

Fuzzy search and score values in CDS view in HANA and not in SQL

former_member219737
Participant
0 Kudos
2,193

Hi Team,

I need to make the Fuzzy search on a particular field in CDS view field.

i tried in blog but i could not able to get it and it was related to SQL and not in CDS.

scenario is -

1. There is a Customer Name field in the table where i need to make the fuzzy search for it.

2. I need to display the score value along with the existing field using cds with revenue field as priority one.

Can anyone suggest an idea on this .

Regards,

Karthik S

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member219737
Participant
0 Kudos

Hi Sai,

I have used the code which you given and can i know how do i check my search functionality ?

Regards,

Karthik S

former_member219737
Participant
0 Kudos

Hi Sai,

Thanks for the reply.

u refer the below link right ? (https://blogs.sap.com/2017/09/18/implementing-fuzzy-search-using-cds-sap-hana/)

Is there an option that i can display the hana fuzzy score value without using AMDP .

Is there an option that i can display hana fuzzy score in the CDS itself.

Regards,

Karthik S

developerone
Contributor
0 Kudos

Please check the hyperlinks I have provided in my response. One of them displays score.

former_member219737
Participant
0 Kudos

Hi Sai,

Thanks for the reply.

I need to publish it to odata service and need to do some more validations. I can publish and do it in this right ?

How can I get the score values in this ? so that i will display along with the existing fields .

REgards,

Karthik S

developerone
Contributor
0 Kudos

You will have to use search annotations.

@Search.searchable : true 

define view SearchForPuducts as select from snwd_pd as Product 
left outer join snwd_texts as ProductDescription 
on Product.desc_guid = ProductDescription.node_key 
  {
key Product.product_id as ID,
@Search.defaultSearchElement : false 
ProductDescription.language as Language,

@Search.defaultSearchElement : true   
@Search.fuzzinessThreshold : 0.8       
@Search.ranking : #HIGH                 
ProductDescription.text as Name,

@Search.defaultSearchElement : true   
@Search.fuzzinessThreshold : 0.7         
@Search.ranking : #LOW             
Product.category as Category
  }

on the columns you would like to enable search for. You might refer to this blog for more information.

some more help here.