Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion combine numericRange query with relationship query

Date: Wed, 18 Apr 2012 02:17:10 -0700 (PDT)
From: Tomas Teicher <tomasteic...@gmail.com>
To: neo4j@googlegroups.com
Message-ID: <21707922.242.1334740630642.JavaMail.geo-discussion-forums@yngu8>
Subject: combine numericRange query with relationship query
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_240_27689366.1334740630640"

------=_Part_240_27689366.1334740630640
Content-Type: multipart/alternative; 
	boundary="----=_Part_241_8763735.1334740630640"

------=_Part_241_8763735.1334740630640
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Is it possible to have  numericRange and relationship check in one query?

I would like to create query that will search for nodes that has a 
relationship with some particular nodes, and also match condition of 
numericRange query.

for example, when I have this graph<http://docs.neo4j.org/chunked/stable/images/indexing-imdb-example.png>
I want to get all movies where Monica Belluci played in years from 1995 to 
2002.
I have created numeric index to property "year".

This command return all movies in years range.
hits = movies.query( QueryContext.numericRange( "year-numeric", from, to ) 
);

How can I add realtionship filter to this query, so it returns only movies 
with Monica Belluci? For example when I know Monica's node ID, so I don't 
need to search for property name "Monica Belluci"?

thanks for any advice
Tomas







------=_Part_241_8763735.1334740630640
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Is it possible to have&nbsp;
<span style=3D"color: rgb(0, 0, 0); font-family: Consolas, Monaco, 'Bitstre=
am Vera Sans Mono', monospace; font-size: 14px; line-height: 18px; text-ali=
gn: left; white-space: pre; ">numericRange and relationship check in one qu=
ery?</span><div><div style=3D"text-align: left;"><font color=3D"#000000" fa=
ce=3D"Consolas, Monaco, 'Bitstream Vera Sans Mono', monospace"><span style=
=3D"font-size: 14px; line-height: 18px; white-space: pre;"><br></span></fon=
t></div><div style=3D"text-align: left;"><font color=3D"#000000" face=3D"Co=
nsolas, Monaco, 'Bitstream Vera Sans Mono', monospace"><span style=3D"font-=
size: 14px; line-height: 18px; white-space: pre;">I would like to create qu=
ery that will search for nodes that has a relationship with some particular=
 nodes, and also match condition of numericRange query.</span></font></div>=
<div style=3D"text-align: left;"><font color=3D"#000000" face=3D"Consolas, =
Monaco, 'Bitstream Vera Sans Mono', monospace"><span style=3D"font-size: 14=
px; line-height: 18px; white-space: pre;"><br></span></font></div><div styl=
e=3D"text-align: left;"><font color=3D"#000000" face=3D"Consolas, Monaco, '=
Bitstream Vera Sans Mono', monospace"><span style=3D"font-size: 14px; line-=
height: 18px; white-space: pre;">for example, when I have <a href=3D"http:/=
/docs.neo4j.org/chunked/stable/images/indexing-imdb-example.png">this graph=
</a></span></font></div><div style=3D"text-align: left;"><font color=3D"#00=
0000" face=3D"Consolas, Monaco, 'Bitstream Vera Sans Mono', monospace"><spa=
n style=3D"font-size: 14px; line-height: 18px; white-space: pre;">I want to=
 get all movies where Monica Belluci played in years from 1995 to 2002.</sp=
an></font></div><div style=3D"text-align: left;"><font color=3D"#000000" fa=
ce=3D"Consolas, Monaco, 'Bitstream Vera Sans Mono', monospace"><span style=
=3D"font-size: 14px; line-height: 18px; white-space: pre;">I have created n=
umeric index to property "year".</span></font></div><div style=3D"text-alig=
n: left;"><font color=3D"#000000" face=3D"Consolas, Monaco, 'Bitstream Vera=
 Sans Mono', monospace"><span style=3D"font-size: 14px; line-height: 18px; =
white-space: pre;"><br></span></font></div><div style=3D"text-align: left;"=
><font color=3D"#000000" face=3D"Consolas, Monaco, 'Bitstream Vera Sans Mon=
o', monospace"><span style=3D"font-size: 14px; line-height: 18px; white-spa=
ce: pre;">This command return all movies in years range.</span></font></div=
><div style=3D"text-align: left;"><code class=3D"java plain" style=3D"borde=
r-top-left-radius: 0px !important; border-top-right-radius: 0px !important;=
 border-bottom-right-radius: 0px !important; border-bottom-left-radius: 0px=
 !important; background-image: none !important; background-attachment: init=
ial !important; background-origin: initial !important; background-clip: ini=
tial !important; background-color: initial !important; bottom: auto !import=
ant; float: none !important; height: auto !important; left: auto !important=
; line-height: 18px; outline-width: 0px !important; outline-style: initial =
!important; outline-color: initial !important; overflow-x: visible !importa=
nt; overflow-y: visible !important; position: static !important; right: aut=
o !important; top: auto !important; width: auto !important; box-sizing: con=
tent-box !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mo=
no', monospace !important; font-size: 14px; min-height: inherit !important;=
 color: rgb(0, 0, 0); white-space: pre; ">hits =3D movies.query( QueryConte=
xt.numericRange( </code><code class=3D"java string" style=3D"border-top-lef=
t-radius: 0px !important; border-top-right-radius: 0px !important; border-b=
ottom-right-radius: 0px !important; border-bottom-left-radius: 0px !importa=
nt; background-image: none !important; background-attachment: initial !impo=
rtant; background-origin: initial !important; background-clip: initial !imp=
ortant; background-color: initial !important; bottom: auto !important; floa=
t: none !important; height: auto !important; left: auto !important; line-he=
ight: 18px; outline-width: 0px !important; outline-style: initial !importan=
t; outline-color: initial !important; overflow-x: visible !important; overf=
low-y: visible !important; position: static !important; right: auto !import=
ant; top: auto !important; width: auto !important; box-sizing: content-box =
!important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', mono=
space !important; font-size: 14px; min-height: inherit !important; color: r=
gb(42, 0, 255) !important; white-space: pre; ">"year-numeric"</code><code c=
lass=3D"java plain" style=3D"border-top-left-radius: 0px !important; border=
-top-right-radius: 0px !important; border-bottom-right-radius: 0px !importa=
nt; border-bottom-left-radius: 0px !important; background-image: none !impo=
rtant; background-attachment: initial !important; background-origin: initia=
l !important; background-clip: initial !important; background-color: initia=
l !important; bottom: auto !important; float: none !important; height: auto=
 !important; left: auto !important; line-height: 18px; outline-width: 0px !=
important; outline-style: initial !important; outline-color: initial !impor=
tant; overflow-x: visible !important; overflow-y: visible !important; posit=
ion: static !important; right: auto !important; top: auto !important; width=
: auto !important; box-sizing: content-box !important; font-family: Consola=
s, Monaco, 'Bitstream Vera Sans Mono', monospace !important; font-size: 14p=
x; min-height: inherit !important; color: rgb(0, 0, 0); white-space: pre; "=
>, from, to ) );</code></div><div style=3D"text-align: left;"><br></div><di=
v style=3D"text-align: left;">How can I add realtionship filter to this que=
ry, so it returns only movies with Monica Belluci? For example when I know =
Monica's node ID, so I don't need to search for property name "Monica Bellu=
ci"?<font color=3D"#000000" face=3D"Consolas, Monaco, 'Bitstream Vera Sans =
Mono', monospace"><span style=3D"font-size: 14px; line-height: 18px; white-=
space: pre;"><br></span></font></div><div style=3D"text-align: left;"><br><=
/div><div style=3D"text-align: left;">thanks for any advice</div><div style=
=3D"text-align: left;">Tomas</div><div style=3D"text-align: left;"><br></di=
v><div style=3D"text-align: left;"><font color=3D"#000000" face=3D"Consolas=
, Monaco, 'Bitstream Vera Sans Mono', monospace"><span style=3D"font-size: =
14px; line-height: 18px; white-space: pre;"><br></span></font></div><div><s=
pan style=3D"color: rgb(0, 0, 0); font-family: Consolas, Monaco, 'Bitstream=
 Vera Sans Mono', monospace; font-size: 14px; line-height: 18px; text-align=
: left; white-space: pre; "><br></span></div><div style=3D"text-align: left=
;"><font color=3D"#000000" face=3D"Consolas, Monaco, 'Bitstream Vera Sans M=
ono', monospace"><span style=3D"font-size: 14px; line-height: 18px; white-s=
pace: pre;"><br></span></font></div><div style=3D"text-align: left;"><font =
color=3D"#000000" face=3D"Consolas, Monaco, 'Bitstream Vera Sans Mono', mon=
ospace"><span style=3D"font-size: 14px; line-height: 18px; white-space: pre=
;"><br></span></font></div><div style=3D"text-align: left;"><font color=3D"=
#000000" face=3D"Consolas, Monaco, 'Bitstream Vera Sans Mono', monospace"><=
span style=3D"font-size: 14px; line-height: 18px; white-space: pre;"> </spa=
n></font></div><div><span style=3D"color: rgb(0, 0, 0); font-family: Consol=
as, Monaco, 'Bitstream Vera Sans Mono', monospace; font-size: 14px; line-he=
ight: 18px; text-align: left; white-space: pre; "><br></span></div></div>
------=_Part_241_8763735.1334740630640--

------=_Part_240_27689366.1334740630640--