Article DetailsDetailsHelp DetailsFull-text search is a powerful feature in Neo4j that allows you to search for text within the properties of nodes and relationships. It provides robust text search capabilities, similar to those found in search engines, which are essential for applications where searching through text data efficiently is crucial.For the full description of full-text search in Neo4j, see the official documentation available here: Full-text search index.When you query a Full-text index, it returns the matching nodes and its score in the output. The score column represents how well the index thinks that the entry matches the given query string. Thus, in addition to any exact matches, full-text indexes return approximate matches to a given query string. This is possible because both the property values that are indexed, and the queries to the index, are processed through the analyzer such that the index can find data entities which do not exactly match the provided STRING. Thus, there would be multiple results for your match string. Let's see it through an example - Create a full-text index on property tagline of Movie node. CREATE FULLTEXT INDEX tagline FOR (n:Movie) ON EACH [n.tagline] Now, if you query with Search String 'Movie on mile', it will return multiple results based on score in descending order. Note that we are doing a fuzzy search here as it uses '~'. WITH 'Movie on mile' as searchTerm CALL db.index.fulltext.queryNodes("tagline", searchTerm+'~') YIELD node, score RETURN node.title, node.tagline But you are actually interested in only for Movies which talks about "mile". In the result set we are seeing a Tagline which does not have "mile" in it but since the search term had "on" keyword that's why it retuned movie with Title "You've Got Mail" as the first result.In order to get more accurate result, you can combine the full-text query with apoc.text.sorensenDiceSimilarity, this will give the expected movie title "The Green Mile" as the first result which has "mile" keyword in the tagline. WITH 'Movie on mile' as searchTerm CALL db.index.fulltext.queryNodes("tagline", searchTerm+'~') YIELD node, score WITH apoc.text.sorensenDiceSimilarity(node.tagline, searchTerm) AS similarity,node,score RETURN node.title, node.tagline, similarity ORDER BY similarity DESC You can also put a filter WHERE similarity > 0.2 in case you want less results in the output. In this example, we get only 1 record which has score above 0.2 NOTE - Utilising full-text search index prior to apoc.text.sorensenDiceSimilarity is more performant rather than using apoc directly.apoc.text.sorensenDiceSimilarity does not uses sort the results based on score so we have to use ORDER BY DESC for sorting purpose. References - How to perform searches using Full-text search indexes?Full-Text Official documentation.APOC Documentation.InformationTitleWorking with Full Text Index and APOC Dice SimilarityArticle Created Date7/3/2024, 8:00 AMURL NameWorking-with-Full-Text-Index-and-APOC-Dice-SimilarityLast Modified Date7/3/2024, 8:18 AM