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.

Hofmann -- specifies the input value<br />

for column LASTNAME<br />

<br />

');<br />

Executing a search and writing the result to a column table provided by the user:<br />

--First create the result table<br />

set schema MY_SCHEMA;<br />

CREATE COLUMN TABLE MY_RESULT_TABLE (<br />

_SCORE FLOAT,<br />

_RULE_ID VARCHAR(255),<br />

"FIRSTNAME" TEXT FUZZY SEARCH INDEX ON FAST PREPROCESS ON,<br />

"LASTNAME" TEXT FUZZY SEARCH INDEX ON FAST PREPROCESS ON<br />

};<br />

-- Afterwards you can execute the search using the created result table.<br />

CALL SYS.EXECUTE_SEARCH_RULE_SET('<br />

<br />

<br />

-- specifies the SearchRuleSet<br />

-- specifies the schema of<br />

the result table<br />

-- specifies the name of the<br />

result table<br />

Herbert -- specifies the input value<br />

for column FIRSTNAME<br />

Hofmann -- specifies the input value<br />

for column LASTNAME<br />

<br />

');<br />

-- get the result<br />

select * from MY_RESULT_TABLE;<br />

Limiting the number of rows returned by a search:<br />

Note: When calling the system procedure EXECUTE_SEARCH_RULE_SET, the application can define the<br />

maximum number of rows that are returned by setting a limit parameter. By default, this parameter is<br />

undefined, which means that an unlimited number of rows is returned. The limitation takes place after<br />

each rule and in the end when all rules are performed. In the following example, a maximum number of<br />

100 rows will be returned. You can use this parameter with the ResultSet object and with the custom<br />

result table.<br />

-- run the search<br />

CALL SYS.EXECUTE_SEARCH_RULE_SET('<br />

<br />

<br />

billy<br />

smith<br />

<br />

');<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. 305

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

Saved successfully!

Ooh no, something went wrong!