I have a query like I wrote below. I couldn't solve the error I gave below even after a lot of effort. I encounter this error when I do any sorting operation. But not always, in specific cases. I think sometimes my query doesn't return Double(NaN) values most of the time, so I rarely encounter this error.
MATCH (news:News {newsId: "/infografik/jurnalist/turkiye-sma-hastaligi-icin-yeni-adimlar-atiyor-26685"})
WITH news
WHERE news.cleanTitle IS NOT NULL
MATCH (otherNews:News {category: news.category})
WHERE news <> otherNews AND otherNews.cleanTitle IS NOT NULL
WITH otherNews,
apoc.text.sorensenDiceSimilarity(news.cleanTitle, otherNews.cleanTitle) AS sorensen
ORDER BY sorensen DESC
LIMIT 10
RETURN otherNews.title, sorensen, otherNews.category;
Error:
Neo.ClientError.Statement.TypeError Wrong argument type: Can't coerce Double(NaN) to String
I want to see results sorted correctly. When I don't sort, I can see the results without any problems. But I need the sorted version. I tried converting the Sorensen value to string, eliminating Null or NaN values. But I was not successful.
apoc.text.sorensenDiceSimilarity(toString(news.cleanTitle), toString(otherNews.cleanTitle))
?toString(apoc.text.sorensenDiceSimilarity(news.cleanTitle, otherNews.cleanTitle))
@cybersam