Я использую ElasticSearch для индексации некоторых из моих моделей, но я вижу, что только одно поле updated
индексируется;ElasticSearch: Elastic4s только индексирует одно поле
Сначала создаю сопоставление;
client execute {
create index "places" mappings(
"shop" as (
"location" typed GeoPointType,
"available" typed BooleanType,
"posted" typed DateType,
"updated" typed DateType
)
)
}
И затем, в методе Shop.save
, я делаю следующее;
posted = new Date
updated = new Date
super.save
// index in ES
client execute {
index into "places" -> "shop" id id fields {
"location" -> GeoPoint.parseFromLatLon(lat.toString + "," + lon.toString)
"available" -> true
"posted" -> posted // field in the object
"updated" -> updated // field in the object
}
}
Но тогда, когда я иду в host:9200/places/shop/1
, я вижу только:
{
_index: "places",
_type: "shop",
_id: "1",
_version: 1,
found: true,
_source: {
updated: "2014-09-11T13:52:40.072Z"
}
}
Что я делаю неправильно?
Редактировать Я использую: elastic4s 1.3.2 elasticsearch 1.3.2 и Scala с Play Framework (2.3.4)