I am new to neo4j and cypher.
neo4j version: 1.6 community
OS: Solaris 10
jdk: 1.6.0_21
I have two types of nodes: "Video" and "Tag".
Video node properties:
type:String="video"
title:String
description:String
url:String
Tag node properties:
type:String= "tag"
name:String
indexes:
type: exact index on "type" property of all nodes
video: fulltext index on "name" and "description" of video nodes
tag: fulltext index on "name" of tag nodes
Videos can have many tags and and tags can be on many videos. I want to write a Cypher query that will produce one list of Videos that meet the following criteria:
1) All Videos where the title or the description properties meet the full text criteria for a keyword search
2) All Videos that are related to a tag where the name property of the tag meets the full text criteria for a keyword search
Sounds simple right?
here is as close as I can get:
start tagged_videos=node:type(type="video"), matched_videos=node:video("name:keyword description:keyword"), tag=node:tag("name:keyword") match tagged_videos-[r]->t return tagged_videos, matched_videos
This returns 2 lists:
tagged_videos: all videos with a relationship to a tag that matches the keyword search
matchd_videos: all videos where either the name property or the description property match the keyword search
I'd like to get a single result list with all the videos in the above two lists. Is there an easy way to do that? like a UNION or something.
Thanks,
Rory