Alireza,

You can approach this multiple ways. If you make a separate spatial index 
for each level, then it is easy to query for nodes of a specified level. If 
you have a single spatial index, then you will need to follow the spatial 
index query with a WHERE clause (if using Cypher) to select for the 
level/type of node. The first solution will probably be faster, but it may 
take up more space.

It does no harm to make other indices.

The best way to answer your questions is to think about the sorts of 
queries you want to make and see what fits most naturally.

Grace and peace,

Jim

On Tuesday, July 22, 2014 10:32:09 AM UTC-4, Alireza Rezaei Mahdiraji wrote:
>
>
> Hi Jim,
>
> I have a tree which level0 are vertices, level 1 are edges, level2 are 
> polygons, etc, 
> Elements on level 0 are only connected to elements in level 1, level 1 to 
> 2 (i.e., the 
> graph relationships). 
>
> 1- In this case, shall I add only vertices (with coordinates) to the 
> spatial index or add 
> all objects in level 1, level 2, etc too? later I have query like 
> subsetting, i.e., having a 
> bounding box I want to see for instance all polygons inside it, etc. 
>
> 2- Do I need to build other type of neo4j indexes i.e., non spatial 
> indexes?
>
> Thanks,
> Best,
> Alireza 
>  
>
>
> On Friday, July 18, 2014 3:25:15 PM UTC+2, Jim Biard wrote:
>>
>> Alireza,
>>
>> These questions are so broad that it's hard to answer.
>>
>> If you want to be able to get all of your different nodes back from a 
>> single query, then they must all be in the same RTree layer (accessed 
>> through a spatial index in Cypher). If different kinds or subsets of 
>> spatial nodes are to be queried separately, then you need a different layer 
>> (and thus different spatial index for Cypher-based queries) for each 
>> separate type or subset. It also depends on the type of geometry you are 
>> using. There are three types of geometries - WKB, WKT, and simple point, 
>> and you cannot mix these within a layer.
>>
>> As for "normal" indexes, it all depends on what you are trying to do. I 
>> can't answer this question, except to say that indexing (some of which is 
>> done transparently if you are using labels) will generally increase 
>> performance.
>>
>> Grace and peace,
>>
>> Jim
>>
>> On Friday, July 18, 2014 4:04:32 AM UTC-4, Alireza Rezaei Mahdiraji wrote:
>>>
>>>
>>> Hi All, 
>>>
>>> Assuming a graph which has 3 to four kind of spatial nodes (e.g., point, 
>>> line, polygon), how many and what type of  
>>> spatial indexes I should build on this graph? How about normal indexes? 
>>> Do I need them too? 
>>> Is there any general guideline on indexing w.r.t. performance? 
>>>
>>>
>>> Best,
>>> Alireza
>>>  
>>>
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to