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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

'abbreviationSimilarity=0.80,textSearch=compare'))<br />

ORDER BY score DESC, id;<br />

SCORE ID NAME<br />

1 5 Hans-Peter<br />

0.800000011920929 6 H.-P.<br />

Search two tokens with abbreviationSimilarity<br />

SELECT SCORE() AS score, id, name FROM abbrev<br />

WHERE CONTAINS(name, 'Go Gerd',FUZZY(0.5,<br />

'abbreviationSimilarity=0.80,textSearch=compare'))<br />

ORDER BY score DESC, id;<br />

SCORE ID NAME<br />

0.905538558959961 8 G Gerd<br />

Option minTextScore<br />

The minTextScore option allows you to set the score a text field has to reach to be a match.<br />

Note: If you use a fuzzySimilarity of 0.0, the parameter minTextScore will be redundant.<br />

DROP TABLE tab_mintextscore;<br />

CREATE COLUMN TABLE tab_mintextscore<br />

(<br />

id INTEGER PRIMARY KEY,<br />

t TEXT FAST PREPROCESS ON FUZZY SEARCH INDEX ON<br />

);<br />

INSERT INTO tab_mintextscore VALUES ('1','Bert');<br />

INSERT INTO tab_mintextscore VALUES ('2','Berta');<br />

INSERT INTO tab_mintextscore VALUES ('3','Bart');<br />

Search on a text column<br />

SELECT SCORE() AS score, id, t FROM tab_mintextscore<br />

WHERE CONTAINS(t, 'Ernie OR Bert', FUZZY(0.100, 'textSearch=compare,<br />

bestMatchingTokenWeight=0,minTextScore=0.70'))<br />

ORDER BY score DESC, id;<br />

SCORE ID T Description<br />

0.7 1 Bert

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

Saved successfully!

Ooh no, something went wrong!