Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-20-2022 11:20 PM
When using the fulltext search and wildcards in queries, the scoring seems to be "lost" and the results have the same score. Is there a way to tell the db to somewhat preserve the scoring?
Example:
CREATE (:Node {name: 'Hello world'});
CREATE (:Node {name: 'Hello world 123'});
CREATE (:Node {name: 'Hell world'});
CREATE (:Node {name: 'Hello again'});
CALL db.index.fulltext.createNodeIndex("names", ["Node"], ["name"], {analyzer: "simple"});
CALL db.index.fulltext.queryNodes("names", 'hello world') YIELD node, score
RETURN node, score
ORDER BY score DESC;
produces the following:
node.name score
"Hello world" 0.32424992322921753
"Hello world 123" 0.32424992322921753
"Hell world" 0.16212496161460876
"Hello again" 0.16212496161460876
But searching for 'hell* world*'
produces
node.name score
"Hello world" 2.0
"Hell world" 2.0
"Hello world 123" 2.0
"Hello again" 1.0
I would have expected 'Hell world' to have a different (higher) score, since it literally matches, without additional characters. Is there a way to solves such responses for queries to score "closest match first"?
Using neo4j:4.0.4-enterprise
.
All the sessions of the conference are now available online