Your ndb.GeoPt part should probably look something like:

survey_marker = ndb.GeoPt(lat=35.1, lon=40.0)

Testing things in interactive console is perfectly normal.

Also, note that your index name needs to be persistent between your 
examples (it was "myIndex" in your previous message, "locate_this" in this 
one and as a variable locate_this (not a string)).

As per the tutorial I mentioned in my first response, the "fields" 
parameter of "search.Document" accepts a list of named fields, not just a 
field. Again, try going over the tutorial 
<https://cloud.google.com/appengine/training/fts_intro/lesson2>as it has 
answers to all of the issues you've had here so far.

Thanks,
Mihail.


On Tuesday, August 4, 2015 at 6:30:45 PM UTC+3, Sourabh Agrawal wrote:
>
> survey_marker= ndb.GeoPt("35.1, 40.0")
> d = search.Document(fields=survey_marker)
> search.Index(name="locate_this").put(d)
> query_obj= "distance(survey_marker , geopoint(35.2, 40.5)) < 10000"
> results = search.Index(name=locate_this).search(query=query_obj)
> print results
> for doc in results:
>     print doc
>
> I wasnt indexing earlier. but as i have indexed now(hopefully it is right 
> ) it returns TypeError: 'GeoPt' object is not iterable. btw I m doing 
> this on interactive console
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/68f33c63-e31b-46d1-a923-e6ce1d1fe41a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to