Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

how score() function works in HANA fuzzy search

$
0
0

Hi, i am confused by the score() returned value when i use this in fuzzy search in HANA

 

CREATE COLUMN TABLE test_similar_calculation_mode

( id INTEGER PRIMARY KEY, s text);

 

INSERT INTO test_similar_calculation_mode VALUES ('1','stringg');

INSERT INTO test_similar_calculation_mode VALUES ('2','string theory');

INSERT INTO test_similar_calculation_mode VALUES ('3','this is a very very very long string');

INSERT INTO test_similar_calculation_mode VALUES ('4','this is another very long string');

 

SELECT TO_INT(SCORE()*100)/100 AS score, id, s FROM test_similar_calculation_mode WHERE CONTAINS(s, 'theory', FUZZY(0.9, 'similarCalculationMode=compare')) ORDER BY score DESC;

 

the returned list is just as below

 

SCORE      ID      S

0.84            2       string theory

 

why i assign 0.9 as threshold in fuzzy function while this line with score 0.84 also be returned.

from my understanding, the S field is text data type, so the string actually is divided into seperate word list, so the score should be 1.0, is it right?

 

any hints is very appreciate,thanks


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>