Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Custom Algorithm for Smart Mastering in JavaScript #331

Open
Smaranika21 opened this issue Aug 30, 2019 · 3 comments
Open

Custom Algorithm for Smart Mastering in JavaScript #331

Smaranika21 opened this issue Aug 30, 2019 · 3 comments

Comments

@Smaranika21
Copy link

@ryanjdew Hi , I was writing a custom algorithm as a part of smart mastering as per my requirement in javascript. I need to construct custom query something like you can see as the return statement bellow, I am using this signature for the function-

function findMatch(expandValues, expandXML, optionsXML) {
//custom logic
return cts.search(cts.jsonPropertyValueQuery("registerName", "*",("case-insensitive","wildcarded","lang=en"),6.0));
}
Test_matching_option.txt

I am attaching the matching option I am using.
Now the issue is this query isnt working when I am calling sm-match API, I can see that log is being generated that I have written in the algorithm. Could you please help?

@Smaranika21
Copy link
Author

Hi, Any help would be appreciated.

@ryanjdew
Copy link
Contributor

Hi @Smaranika21,

Your custom algorithm should only return a cts query, not the results of cts.search. e.g.,

function findMatch(expandValues, expandXML, optionsXML) {
//custom logic
  return cts.jsonPropertyValueQuery("registerName", "*",("case-insensitive","wildcarded","lang=en"),6.0);
}

@Smaranika21
Copy link
Author

Thanks for your answer, I have tried that as well but not getting the expected result. As you can see, this query should match any value for the field "registerName" but I am getting this result attached here when I am executing sm-match function with the match option that I have shared before.
result.txt
It is not considering "registerName" as matched item.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants