Prabudda Sri Rahal
Prabudda Sri Rahal

Reputation: 469

neo4j full text search get property that contain keyword

Referring to the documentation https://neo4j.com/docs/cypher-manual/3.5/schema/index/#schema-index-fulltext-search-query

Consider below full text search query

CALL db.index.fulltext.queryNodes("titlesAndDescriptions", 'Full Metal Jacket') YIELD node, score RETURN node

How do I get which property matches the search keyword keyword. (i.e in above example 'Full Metal Jacket' found in title or description ?)

Upvotes: 1

Views: 425

Answers (1)

Graphileon
Graphileon

Reputation: 5385

you could do something like:

WITH 'Full Metal Jacket' AS searchString 

CALL db.index.fulltext.queryNodes("titlesAndDescriptions", searchString) YIELD node, score 
WITH node,
     node.title CONTAINS searchString AS inTitle,
     node.description CONTAINS searchString AS inDescription

RETURN node,inTitle,inDescription

Upvotes: 0

Related Questions