failed to find geopoint field
See original GitHub issueI have seperate fields of latitude and longitude (lat and lng) in my django model. I want to use GeoPoint field but getting error failed to find geopoint field.
In my models file , I have added function:
@property def type_to_string(self): return { 'lat': self.lat, 'lon': self.lng }
Created GeoPointField in documents.py loc1 = fields.GeoPointField(attr=‘type_to_string’)
Now when I run the query
s1 = LocationDocument.search().filter( ‘geo_distance’, distance=‘1000m’, loc1={“lat”: “40”, “lon”: “-74”} )
s1 = s1.execute()
I get error here. Any help where I am going wrong.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
ElasticSearch QueryParsingException failed to find geo_point ...
But when I try to run this query, the elasticsearch.log pops up with an error: [locations] failed to find geo_point field [coordinates].
Read more >Failed to find geo_point field " + fieldName + " - Opster
A detailed guide on how to resolve errors related to "failed to find geo_point field " + fieldName + ""
Read more >Failed to find geo_point field [destination.geo.location]
Hello everyone, I am having some problems with geo.location showing up on that maps with errors. This is my errors" query_shard_exception at ...
Read more >Geospatial Support in ElasticSearch - Baeldung
Geo-point field type accepts latitude-longitude pairs that can be used to: Find points within a certain distance of central point; Find points ...
Read more >Not able to query geo_point field, even though in my mapping ...
... ID on the location field I get an error saying failed to find geo_point field [answers.BAqyR5EEaEPCsMPocHYs.location]". This is my query
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This looks like your index wasn’t created with proper mappings in place, you need to explicitly create the index before indexing any data into it.
In elasticsearch dsl you do it by calling the
init()
classmethod on yourDocument
subclass.Hope this helps!
RequestError: RequestError(400, ‘search_phase_execution_exception’, ‘failed to find geo_point field [loc1]’)