Skip to content

Instantly share code, notes, and snippets.

@timothylhuillier
Created November 19, 2013 15:07
Show Gist options
  • Save timothylhuillier/7546717 to your computer and use it in GitHub Desktop.
Save timothylhuillier/7546717 to your computer and use it in GitHub Desktop.
Mapping ES de PTF (searchly) pour le type "products"
curl -XPUT 'http://site:161b0995758bdf791bbfd46e1e9783c7@eu-west-1.searchbox.io/ptf/products/_mapping' -d
'{"products":{"properties":{"deleted_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"},"description":{"type":"string"},"location":{"type":"geo_point"},"photo":{"type":"string","index":"not_analyzed"},"price":{"type":"float"},"quantity":{"type":"string"},"shared_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"},"created_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"},"expiry_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"},"title":{"type":"string"},"user":{"properties":{"email":{"type":"string"},"id":{"type":"integer"},"name":{"type":"string"},"photo":{"type":"string","index":"not_analyzed"}}}}}}'
$params['body']['products']['mappings'] = [
"properties" => [
"deleted_at" => [
"type" => "date",
"format" => "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
],
"description" => [
"type" => "string"
],
"location" => [
"type" => "geo_point"
],
"photo" => [
"type" => "string",
"index" => "not_analyzed"
],
"price" => [
"type" => "float"
],
"quantity" => [
"type" => "string"
],
"shared_at" => [
"type" => "date",
"format" => "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
],
,
"created_at" => [
"type" => "date",
"format" => "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
],
"expiry_at" => [
"type" => "date",
"format" => "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
],
"title" => [
"type" => "string"
],
"user" => [
"properties" => [
"email" => [
"type" => "string"
],
"id" => [
"type" => "integer"
],
"name" => [
"type" => "string"
],
"photo" => [
"type" => "string",
"index" => "not_analyzed"
]
]
]
]
];
curl -XPUT 'http://site:161b0995758bdf791bbfd46e1e9783c7@eu-west-1.searchbox.io/ptf/users/_mapping' -d
'{"properties": {"activated": {"type": "boolean"},"location": {"type": "geo_point"},"name": {"type": "string"},"photo": {"type": "string","index": "not_analyzed"}}}'
$params['body']['users']['mappings'] = [
"properties" => [
"activated" => [
"type" => "boolean"
],
"location" => [
"type" => "geo_point"
],
"name" => [
"type" => "string"
],
"photo" => [
"type" => "string",
"index" => "not_analyzed"
]
]
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment