Hi All,
I got an error:
Elasticsearch\Common\Exceptions\BadRequest400Exception: {"error":{"root_cause":[{"type":"parse_exception","reason":"latitude must be a number"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"parse_exception","reason":"latitude must be a number"}},"status":400}
Mapping
'location' => [
'properties' => [
'latitude' => [
'type' => 'float',
'fields' => [
'raw' => [
'type' => 'float',
]
]
],
'longitude' => [
'type' => 'float',
'fields' => [
'raw' => [
'type' => 'float',
]
]
],
]
],
.....
'pin' => [
'properties' => [
'location' => [
'type' => 'geo_point',
]
]
],
Get the indexable data array for the model
'pin' => [
'location' => [
'lat' => $this->latitude,
'lon' => $this->longitude,
]
]
Elastic
{
"name" : "...",
"cluster_name" : "laradock-cluster",
"cluster_uuid" : "...",
"version" : {
"number" : "6.2.3",
"build_hash" : "...",
"build_date" : "2018-03-13T10:06:29.741383Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
The longitude and latitude are float. I think because of NULL issue. Anyway I need to have NULL value for geopoint.
Do you have any solution for this issue?
Thank you,