Skip to Content

Fuzzy Search not working in CDS view

Hi,

I have created an entity in HCP and a CDS view with a select on the same table. I have enabled fuzzy search with a tolerance of 0.9 (on both the fields) however my query returns all the values on any search string. Please let me know where I am mixing things up. Any help is highly appreciated.

Entity Definition

namespace XXXX.YYY.ZZZ.ARKA;

@Schema: 'ABCD'

context ar3 {

@Catalog.tableType: #COLUMN

entity Products{

key matnr : String(18); // MARA - char 18

@SearchIndex.text.enabled : true

@SearchIndex.fuzzy.enabled : true

maktx : String(40); // MAKT - char 40 - Description

@SearchIndex.text.enabled : true

@SearchIndex.fuzzy.enabled : true

};

CDS Definition

@Search.searchable: true

define view Fuzzy as select from Products as Products {

@EnterpriseSearch.key : true

@Search.ranking: #HIGH

@Search.defaultSearchElement: true

@Search.fuzzinessThreshold : 0.9

Products.matnr,

@Search.ranking: #HIGH

@Search.defaultSearchElement: true

@Search.fuzzinessThreshold : 0.9

Products.maktx };

};

URL

https://myserver.hana.ondemand.com/xxxx/yyyy/zzz/ARKA/Fuzzy.xsodata/FuzzySet?$search=%27ARKA%27

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 24, 2016 at 06:56 AM

    Hi Arkajeet,

    The parameter name is 'search', not '$search'.

    The OData service ignores the unknown parameter name '$search', so you do not get back an error.

    Regards,

    Joerg

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.