Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created May 16, 2019 17:34
Show Gist options
  • Save vladbatushkov/8b6a9edb2883db221367ebc4bcf763e9 to your computer and use it in GitHub Desktop.
Save vladbatushkov/8b6a9edb2883db221367ebc4bcf763e9 to your computer and use it in GitHub Desktop.
Set keywords from movie review.
MATCH (m:Movie)
CALL apoc.load.html(m.url, { reviews: "div.article__body p" }) YIELD value
WITH split(value.reviews[0].text + " " + value.reviews[1].text, " ") as keywords, m
WITH [x IN keywords | apoc.text.replace(x, "[\\.\\,\\(\\)\\']", "")] as keywords, m
SET m.keywords = filter(x IN keywords WHERE size(x) > 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment