The geo index results are currently provided by AQL functions NEAR() and 
WITHIN() only.

Functions in AQL queries are evaluated completely, meaning the full 
function result needs to be constructed. There is no lazy generation of 
function results.
That means in the query

    FOR doc IN NEAR(...)
      LIMIT 1
      RETURN doc

will fully construct the results of the NEAR() function call and later 
discard all results but the first document.
This is different to collection scans and index accesses that allow lazy 
construction of results.
Changing the behavior or NEAR() and WITHIN() is on our to do list, but not 
for the upcoming release.

The number of results for NEAR() can be restricted by passing it a limit 
parameter (which defaults to 100 IMHO), the results of WITHIN() can be 
restricted by specifying a radius.

Best regards
Jan

Am Dienstag, 27. September 2016 10:36:42 UTC+2 schrieb Thomas Weiss:
>
> Thanks Jan!
> I remember reading in the forum that geo-indexes don't play well with 
> cursors.. Is there anything I should be aware of?
>
> Thomas
>
> On Tuesday, September 27, 2016 at 3:12:34 PM UTC+8, Jan wrote:
>>
>> Hi,
>>
>> in both 2.8 and 3.0 (plus devel if that matters) the results of NEAR and 
>> WITHIN are sorted by distance, with closest distances being returned first.
>> That means the docs on 
>> https://docs.arangodb.com/3.0/AQL/Functions/Geo.html are wrong. We'll 
>> fix that.
>>
>> Best regards
>> Jan
>>
>> Am Montag, 26. September 2016 14:45:45 UTC+2 schrieb Thomas Weiss:
>>>
>>> Hi,
>>>
>>> This page <https://docs.arangodb.com/3.0/Manual/Indexing/Geo.html> 
>>> states that the NEAR and WITHIN functions return documents as a list that 
>>> is "sorted by distance, beginning with the nearest document". But that 
>>> page <https://docs.arangodb.com/3.0/AQL/Functions/Geo.html> says that 
>>> "the order in which the result documents are returned is undefined".
>>> Which one is true?
>>>
>>> Thanks,
>>> Thomas
>>>
>>

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

Reply via email to