I have input coming in from a database , specifically call detail records , I need to parse the calling party number to identify the country from a dictionary file.
The problem I am facing is that unless the input field is exactly equal to the value in dictionary , it doesn't match , For example:
The expected result is that it should match 93706 - Afghanistan - AWC as best match , but it doesn't , as the full number 937066 is not in dictionary , Is it possible to force it to use best match instead of exact match , or is there any other way I can match against a dictionary using best match?
Operationally, if the event field specified in the field configuration matches the EXACT contents of a dictionary entry key (or matches a regex if regex configuration item has been enabled), the field’s value will be substituted with the matched key’s value from the dictionary.
Depending on how your caller ids are coming in then you may be able use a regex.
In the case above, if you only have five significant characters in your dictionary then you could mutate the calling_mut to five chars and search on that.
Thanks a lot for the reply , The problem is that the dictionary has some countries with detailed in-country operator breakdown as well and some of them are just country codes.
I am looking up the first 5 digits , if i used exact => false , It does match it but iterates through each character in the input field separately and matches so
937066 results in AfghanistanRussia0Thailand
93 - afghanistan
7 - Russia
0 - Not in dictionary
66 - Thailand
Is there any way to trigger this match , as its pretty critical to what i am trying to do.
The translate filter supports regex matching, so you can enable regex mode and store regexes as key. With that many regex entries it could however possibly be slow, but you will need to benchmark it.
Just reverting back here , for my specific use - case , identifying country code from number , I achieved it by using custom ruby code and phonelib , which is based on libphonenumber from google.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.