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.

);<br />

id INTEGER PRIMARY KEY,<br />

s NVARCHAR(255)<br />

INSERT INTO test_similar_calculation_mode VALUES ('1','stringg');<br />

INSERT INTO test_similar_calculation_mode VALUES ('2','string theory');<br />

INSERT INTO test_similar_calculation_mode VALUES ('3','this is a very very<br />

very long string');<br />

INSERT INTO test_similar_calculation_mode VALUES ('4','this is another<br />

very long string');<br />

similarCalculationMode compare<br />

SELECT TO_INT(SCORE()*100)/100 AS score, id, s<br />

FROM test_similar_calculation_mode<br />

WHERE CONTAINS(s, 'explain string theory', FUZZY(0.5,<br />

'similarCalculationMode=compare'))<br />

ORDER BY score DESC;<br />

Score ID S<br />

0.69 2 string theory<br />

similarCalculationMode search<br />

SELECT TO_INT(SCORE()*100)/100 AS score, id, s<br />

FROM test_similar_calculation_mode<br />

WHERE CONTAINS(s, 'explain string theory', FUZZY(0.5,<br />

'similarCalculationMode=search'))<br />

ORDER BY score DESC;<br />

Score ID S<br />

0.68 4 this is another very long string<br />

0.66 3 this is a very very very long string<br />

0.65 2 string theory<br />

similarCalculationMode symmetricsearch<br />

SELECT TO_INT(SCORE()*100)/100 AS score, id, s<br />

FROM test_similar_calculation_mode<br />

WHERE CONTAINS(s, 'explain string theory', FUZZY(0.5,<br />

'similarCalculationMode=symmetricsearch'))<br />

ORDER BY score DESC;<br />

Score ID S<br />

0.85 2 string theory<br />

0.71 1 stringg<br />

0.61 4 this is another very long string<br />

0.58 3 this is a very very very long string<br />

262<br />

P U B L I C<br />

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

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

Enabling Search

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

Saved successfully!

Ooh no, something went wrong!