If your resultset returns too many records is going to be slow sorting
after retrieving the results.
If you results have to be paginated in most cases you have to sort
over the full resultset.
Also if you plan to get things ordered by multiple properties you need
some kind of btree structure.
This is the kind of stuff that is easier to accomplish with most
relational dbs since they keep track of indexes for you.
After trying different approaches in our case it came down to keep
ordered relationships asc and desc as their own relationship.
We will be releasing in the next couple of months a Java Interface
mapping to the neo store that uses java dynamic proxies that access
the store lazyly and allows you to transparently keep track of ordered
relationships behind the scenes by keeping results ordered at
insertion time.
Neo4j lacks the concept of indexes where you can setup indexes to get
results ordered by arbitrary properties or relationships.
AFAIK returning nodes ordered by properties in neo requires full
traversal/scan then sorting on all the results.

2010/2/24 Satish Varma Dandu <[email protected]>:
> Hi John,
>
>  Thanks for the reply.  Consider a scenario like LinkedIn:
> 1) I wanna search for all profiles in linkedin matching "Neo4J"
> 2) Now i get, lets say 20 people having Neo4J on their profiles. So far so
> good. But i wanna order these search results based on my order. Like first i
> wanna search results from my direct contacts followed by next order results.
>
> The worst case scenario is, once i get these search results, for each search
> result profile, i need to traverse & find the path. But this take a lot of
> time if i get 2 many search results. So somehow i wanna combine both Lucene
> & traverse. Is this doable with Neo4J?
>
> Hope i explained the problem. Any help would be great.
>
> Thanks,
> -Satish
>
> On Wed, Feb 24, 2010 at 1:29 AM, Johan Svensson 
> <[email protected]>wrote:
>
>> Hi,
>>
>> You can not make such an ordered search using the Lucene indexing
>> service. You could try to only use a traverser instead of a Lucene
>> search and let the traverser do the filtering.
>>
>> I am not sure I understand your problem completely. If you could
>> describe the problem in more detail I am sure we can come up with a
>> good solution for it.
>>
>> Regards,
>> -Johan
>>
>> On Tue, Feb 23, 2010 at 11:00 PM, Satish Varma Dandu <[email protected]>
>> wrote:
>> > Hi,
>> > I am new to Neo4J, and so far it looks really good for traversing nodes.
>> I
>> > have a question on using Traverser API. Can we order the lucene search
>> > results by degree wise. When i search for some data using lucene, i will
>> get
>> > some nodes. Now i want to arrange those search results nodes in the order
>> of
>> > level.i.e first i want results from my direct nodes & then next level of
>> > nodes etc.
>> >
>> > Is this supported out of the box? Appreciate if you could point me to
>> > correct resource.
>> >
>> > Thanks & Regards,
>> > -Satish
>> _______________________________________________
>> Neo mailing list
>> [email protected]
>> https://lists.neo4j.org/mailman/listinfo/user
>>
> _______________________________________________
> Neo mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Raul Raja
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to