I have simple repository to save my status log
class OrderStatusRepository
include Elasticsearch::Persistence::Repository
include Elasticsearch::Persistence::Repository::DSL
def index_name
"statuses-#{ Time.now.strftime('%Y-%m')}"
end
mapping do
indexes :src_location, type: 'geo_point'
indexes :dst_location, type: 'geo_point'
end
end
The issue is mapping is not applied, when i add some data.
{"id":158,"src_location":"1.486912, 2.493157","dst_location":"11.489026, -22.501309"}
"dst_location": {
"type": "text", #NOT GEOPOINT !!!!
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
I can create the index and mappings manually, but it has dynamic name and i'm not going to do it every month/day.
Is there any way to automate this? Thanks.