Fuzzy Searching sypport in OUAF V4.2.0.0.0

One of the most common requirements in products using Oracle Utilities Application Framework is searching for records using various criteria. In Oracle Utilities Application Framework we provide a set of Query Zones that allow SQL to be used to retrieve information using whatever criteria is configured. In most cases we support precise and/or wildcarding (this is configurable). In Oracle Utilities Application Framework V4.2.0.0.0 we added support for inprecise or fuzzy searching using the facilities provided in Oracle Text.

Oracle Text is a component of all editions of the Oracle Database that allows for special indexes and additional clauses to provide a wide range of text searching and processing options. One of the major features of Oracle Text in Oracle Database 11gR2 is Name searching. This facility allows implementations to specify addtional SQL clauses to implement fuzzy or inprecise searching names and addresses in 20+ languages natively in the database.

For example, say you were looking for a customer with the name Bill. Fuzzy searching would allow Bill, William, Willy, Billy etc to be returned as well as they are valid variations of the name. This applies to surnames and addresses as well. For example, if you were looking at a surname of Smith, you could get results back of valid variations such as Smythe, or Smithe etc...

This Oracle Text facility is now interfaced using a new @fuzzy helper function (that is what I call it) to get the SQL query to implement the new SQL clauses easily in Query zones.

The process to implement this is summarized as follows:

  • Enable Oracle Text on the database. By default, it is not enabled. This is a one off DBA DCL statement.
  • Grant access to Oracle Text to the product users.This is a one off DBA DCL statement.
  • Create Oracle Text indexes with the necessary parameters on the columns you want to apply the searching on. This will build special entries and variations for the SQL to use for you. The index creation allows you to customize the attributes and dictionaries used by the search to return the variations.
  • Use the @fuzzy helper function in your Query zone SQL against the columns indexed and with the necessary configuration.

The @fuzzy helper function provides a number of parameters:

@fuzzy(term, score, numresults, weighting) where:

 term Value to search on
 score The degress of fuzziness. Values between 1 - 80. The higher the number the more precise the search. Default is 60.
 numresults Number of variations to consider for the term. Number between 1 and 5000. Default is 100.
 weighting Whether the results are returned in order of score/weight. Specify WEIGHT to enable this. 

In the query zone you can default the values or provide them as parameters. For example:

To pass user data as term parameter and use default values of the remaining fuzzy operator parameters the zone SQL will need to be defined as following:

SELECT USER_ID, LAST_NAME from SC_USER WHERE CONTAINS(LAST_NAME, @fuzzy(:F1)) > 0;

To pass user data as term parameter in fuzzy operator, and to set score to 70, number results to 6, and to specify weight the zone SQL will need to be defined as following.

SELECT USER_ID, LAST_NAME from SC_USER WHERE CONTAINS(LAST_NAME, @fuzzy(:F1, 70, 6, ‘weight’)) > 0;

To pass user data as term parameter and a score in fuzzy operator, to set number results to 6, and to specify weight the zone SQL will need to be defined as following:

SELECT USER_ID, LAST_NAME from SC_USER WHERE CONTAINS(LAST_NAME, @fuzzy(:F1, :F2, 6, ‘weight’)) > 0;

Skip unnecessary parameters using the appropriate number of commas. For example:

SELECT USER_ID, LAST_NAME from SC_USER WHERE CONTAINS(LAST_NAME, @fuzzy(:F1,,,‘weight’)) > 0;

For more details of this facility and some general advice about Oracle Text refer to the Using Oracle Text for Fuzzy Searching Oracle Utilities Application Framework (Doc Id: 1561930.1) whitepaper available from My Oracle Support.

The key to the right results is the configuration of the Oracle Text Index. Refer to the Oracle Text documentation

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Anthony Shorten
Hi, I am Anthony Shorten, I am the Principal Product Manager for the Oracle Utilities Application Framework. I have been working for over 20+ years in the IT Business and am the author of many a technical whitepaper, manual and training material. I am one of the product managers working on strategy and designs for the next generation of the technology used for the Utilities and Tax markets. This blog is provided to announce new features, document tips and techniques and also outline features of the Oracle Utilities Application Framework based products. These products include Oracle Utilities Customer Care and Billing, Oracle Utilities Meter Data Management, Oracle Utilities Mobile Workforce Management and Oracle Enterprise Taxation and Policy Management. I am the product manager for the Management Pack for these products.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
9
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today