28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2000-01-11 -> 0.96<br />

2000-01-12 -> 0.92<br />

2000-01-13 -> 0.90<br />

2000-01-14 -> 0.90<br />

2000-01-15 -> 0.90<br />

2000-01-16 -> 0.90<br />

Search Rules<br />

Overview<br />

With fuzzy search in <strong>SAP</strong> <strong>HANA</strong>, you can search for structured database content that is similar to the user input.<br />

In this case, the user input and the records in the database are nearly the same but differ in their spelling (for<br />

example, typing errors) or contain additional information (for example, additional or missing terms).<br />

Among the use cases of fuzzy search on structured data, there is the prevention of duplicate records. New<br />

database records can be checked for similar and already existing records in real time, just before the new record<br />

is saved.<br />

For example, before saving a new customer to the database, the application checks for similar customers that<br />

may be duplicates of the newly entered customer. The application does some searches and then presents to the<br />

user any existing customers that are similar to the user input. The user then decides whether to create a new<br />

customer (because the records presented are similar, but not really duplicates) or to accept one of the existing<br />

customers and continue with this customer record.<br />

The searches performed by the application are defined by business rules that define when two customers are<br />

similar. For example, two customers may be considered similar by the application as soon as one of the following<br />

conditions is true:<br />

1. The customers' names and addresses are similar.<br />

2. The customers' last names and addresses are identical but the first names are different (may be persons<br />

living in the same household).<br />

3. The customers' names are similar and the dates of birth are identical.<br />

These rules can be hardcoded in the application by writing three SELECT statements that do the three searches<br />

defined above. Whenever the requirements for the search rules change, the application code has to be changed,<br />

tested and deployed to the productive system. This may be costly in terms of time and development resources<br />

needed.<br />

Alternatively, the application can use search rules to store the rules as a configuration object in the <strong>SAP</strong> <strong>HANA</strong><br />

database. Instead of embedding the rules in SELECT statements that are part of the application code, the<br />

application has to call a database procedure only to process all rules defined in the configuration object.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Enabling Search<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 301

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!