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.

Supported Data Types<br />

Fuzzy search works out-of-the-box on the following column-store data types:<br />

● TEXT<br />

● SHORTTEXT<br />

● VARCHAR, NVARCHAR<br />

● DATE<br />

● All data types with a full-text index<br />

String Types<br />

String types support a basic fuzzy string search. The values of a column are compared with the user input, using<br />

the fault-tolerant fuzzy string comparison.<br />

When working with string types, the fuzzy string comparison always compares the full strings. If searching with<br />

'<strong>SAP</strong>', for example, a record such as '<strong>SAP</strong> Deutschland AG & Co. KG' gets a very low score, because only a very<br />

small part of the string is equal (3 of 27 characters match).<br />

A fuzzy search on string types is an alternative to a non-fault-tolerant SQL statement such as<br />

SELECT ... FROM products WHERE product_name = 'coffe krisp biscuit' ...<br />

which would not return any results because of the spelling errors.<br />

Supported SQL data types are<br />

● VARCHAR<br />

● NVARCHAR<br />

It is possible to speed up the fuzzy search by creating additional data structures, which are used for faster<br />

calculation of the fuzzy score. These data structures exist in the memory only, so no additional disk space is<br />

required.<br />

To get the best response times possible, you should enable the fast fuzzy search structures for all database<br />

columns that have a high load of fuzzy searches, and for all database columns that are used in performance-<br />

critical queries.<br />

Text Types<br />

Text types support a more sophisticated kind of fuzzy search. Texts are tokenized (split into terms) and the fuzzy<br />

comparison is done term by term.<br />

For example, when searching with '<strong>SAP</strong>', a record such as '<strong>SAP</strong> Deutschland AG & Co. KG' gets a high score,<br />

because the term '<strong>SAP</strong>' exists in both texts. A record such as '<strong>SAP</strong>PHIRE NOW Orlando' gets a lower score,<br />

because '<strong>SAP</strong>' is only a part of the longer term '<strong>SAP</strong>PHIRE' (3 of 8 characters match).<br />

A fuzzy search in text columns replaces non-fault-tolerant statements such as<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. 263

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

Saved successfully!

Ooh no, something went wrong!