Hi,
I need to transform a text about a place (i.e. Copenhagen , Capital Region, Denmark) in a structured data:
{
"professionals": 15644,
"elevation": "",
"name": "Copenhagen",
"modification_date": "2012-11-26",
"country": "Denmark",
"feature_class": "P",
"admin3_code": "",
"admin2_code": "101",
"cc2": "",
"timezone": "Europe/Copenhagen",
"feature_code": "PPLC",
"dem": "14",
"country_code": "DK",
"admin1_code": "17",
"alternatenames": "CPH,Cobanhavan,Copenaga,Copenaghen,Copenaguen,Copenhaga,Copenhagen,Copenhague,Copenhaguen",
"asciiname": "Copenhagen",
"population": "1153615"
}
I've the database to do that, but the results I get are far from perfection.
Currently I use:
"query": {
"function_score": {
"query": {
"query_string" : {
"query": "Copenhagen OR (Capital Region) OR Denmark",
"fields": [ "name", "country", "alpha-2", "alternatenames" ] ,
"use_dis_max" : True
}
},
"functions": [{
"field_value_factor": {
"field": "population"
}
}],
"score_mode": "multiply"
}
}
Suggestions to improve it?