Skip to content

Instantly share code, notes, and snippets.

@thom4parisot
Created December 3, 2012 15:28
Show Gist options
  • Select an option

  • Save thom4parisot/4195721 to your computer and use it in GitHub Desktop.

Select an option

Save thom4parisot/4195721 to your computer and use it in GitHub Desktop.
DataLocale Hosting — OpenRefine + ElasticSearch Export
[
{
"op": "core/column-removal",
"description": "Remove column File",
"columnName": "File"
},
{
"op": "core/text-transform",
"description": "Text transform on cells in column Adresse using expression grel:if (isNonBlank(cells[\"Adresse suite\"].value), join([value, cells[\"Adresse suite\"].value], \"\\n\"), value)",
"engineConfig": {
"facets": [
{
"invert": false,
"expression": "value",
"selectError": false,
"omitError": false,
"selectBlank": false,
"name": "Statut",
"omitBlank": false,
"columnName": "Statut",
"type": "list",
"selection": [
{
"v": {
"v": "Producteur",
"l": "Producteur"
}
}
]
}
],
"mode": "row-based"
},
"columnName": "Adresse",
"expression": "grel:if (isNonBlank(cells[\"Adresse suite\"].value), join([value, cells[\"Adresse suite\"].value], \"\\n\"), value)",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
},
{
"op": "core/column-removal",
"description": "Remove column Adresse suite",
"columnName": "Adresse suite"
},
{
"op": "core/text-transform",
"description": "Text transform on cells in column Site web using expression grel:if(isNonBlank(value), 'http://'+replace(value, /^https?:\\/\\//, ''), null)",
"engineConfig": {
"facets": [
{
"invert": false,
"expression": "value",
"selectError": false,
"omitError": false,
"selectBlank": false,
"name": "Statut",
"omitBlank": false,
"columnName": "Statut",
"type": "list",
"selection": [
{
"v": {
"v": "Producteur",
"l": "Producteur"
}
}
]
}
],
"mode": "row-based"
},
"columnName": "Site web",
"expression": "grel:if(isNonBlank(value), 'http://'+replace(value, /^https?:\\/\\//, ''), null)",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
},
{
"op": "core/text-transform",
"description": "Text transform on cells in column Classement label using expression grel:if(isNonBlank(value), value.match(/.*(\\d+)\\D+$/)[0], 0)",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Classement label",
"expression": "grel:if(isNonBlank(value), value.match(/.*(\\d+)\\D+$/)[0], 0)",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
},
{
"op": "core/text-transform",
"description": "Text transform on cells in column Site web using expression grel:if(isNonBlank(value), 'http://'+replace(value, /^https?:\\/\\//, ''), null)",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Site web",
"expression": "grel:if(isNonBlank(value), 'http://'+replace(value, /^https?:\\/\\//, ''), null)",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
}
]
{"index": {"_type": "hosting"}}
{"name" : {{jsonize(cells["Raison sociale"].value)}}, "address" : {{jsonize(cells["Adresse"].value)}}, "postal_code" : {{jsonize(cells["Code postal"].value)}}, "city" : {{jsonize(cells["Commune"].value)}}, "phone" : {{jsonize(cells["Tél. information/réservation"].value)}}, "website" : {{jsonize(cells["Site web"].value)}}, "labels" : {{jsonize(cells["Label"].value.split(";"))}}, "label_ranking" : {{jsonize(cells["Classement label"].value)}}, "theme_labels" : {{jsonize(cells["Thèmes label"].value.split(";"))}}, "lifestyle" : {{jsonize(cells["Style de vie"].value.split(";"))}}, "handicap" : {{jsonize(cells["Tourisme et Handicap"].value)}}, "location" : [{{jsonize(cells["Longitude"].value)}}, {{jsonize(cells["Latitude"].value)}}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment