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

Multiple rule config #330

Open
debashissinha opened this issue Aug 12, 2019 · 3 comments
Open

Multiple rule config #330

debashissinha opened this issue Aug 12, 2019 · 3 comments

Comments

@debashissinha
Copy link

Hi @ryanjdew ,

I Ryan I have a scenario which I need some insight from you . How do we configure multiple rules in options.xml to be executed on a set of document .

Lets say we have three field json consisting of in two document and we intend to match them
a) fName
b) lName
c) gender

The rule that we intend to apply is

i) fname and lname should match gender may not match
ii) fname matches but lname doesn't matches and gender gain matches.
iii) fname doesnt match but lname and gender matches.

My question here is if rule 1 doesn't matches then rule 2 will execute . if rule 2 doesn't match rule three will execute and give a result . If none matches we get unmatched .Is there any way to achieve this .Please if you can provide some documentation or example will help a lot .

Thanks & Regards
Debashis Sinha

@aajacobs
Copy link
Contributor

Hi @debashissinha,

You can do what you want by adjusting the matching weights and the merging threshold. If you set, for example, a weight for each of the properties (fname, lname and gender) to be 5, and set your merging threshold to be 10, that will allow all of your rules to be enforced as described.

i) fname match (5 points) + lname match (5 points) + gender no match (0 points) = 10 points, so merge
ii) fname match (5 points) + lname no match (0 points) + gender match (5 points) = 10 points, so merge
iii) fname no match (0 points) + lname match (5 points) + gender match (5 points) = 10 points, so merge

Smart Mastering doesn't have an 'if, then, else' style of execution but instead relies on the MarkLogic search capabilities to run its matching process as a single query per record.

Also, please note that the capabilities of smart-mastering-core have been moved into the MarkLogic Data Hub, which is where all new enhancements will be taking place. So any future questions or enhancement requests for Smart Mastering can be made on the Data Hub github project.

@debashissinha
Copy link
Author

Hi @aajacobs
Thank you so much for your help it works.....

@debashissinha
Copy link
Author

debashissinha commented Aug 20, 2019

Hi @aajacobs , @ryanjdew ,

In the proposed solution above I found that it is possible that while performing match it might happen that two or three such element may match whose summation is equivalent to score of a rule but the element considered in rule and the ones that matched are not same .

E.g
i) fname match (5 points) + lname match (5 points) + gender no match (0 points) = 10 points, so merge

It is possible in the above match that in my options.xml I have the following weightages

city (weight = 3)
country (weight = 4)
zip (weight = 3 )

So it might be possible that rule 1 which states that fname ,lname match and when there is no gender match will give a total score of 10 .

But it doesn`t satisfies rule that is fname , lname , gender nothing matches but instead city country and zip matches . In this case also the cumulative score is 10 and rule one got satisfied whereas the element matched were different . So rule 1 got satisfied but for a entirely different field values .

Can you suggest some way to avoid this .

Thanks & Regards
Debashis Sinha

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