I'm creating on my own a little Geocoder. My goal is to be able to retrieve
a big city or a country with a string on input. This string can be
mistyped, so I indexed geonames cities5000 data (cities > 5000 inhab), and
crossed theses data with countries & admin data. So I got a 46000 cities
index with country, admin & pop.
I created a search_field in which I put country, admin & city name +
alternate names provided in cities5000 file.
I want, within this array, search for a string.
Currently, I'm just searching with a MatchQuery, like "Paris" in
"search_field". Unfortunately, the first result is Paris... in Canada...
Still, the "search_field" data is this one, for Paris (CA) and Paris (FR):
[u'Paris', u'Paris', u'Canada', u'Ontario', u'Ontario']
[u'Paris', u'Paris', u'France', u'\xcele-de-France', u'Ile-de-France', u'Paris', u'Paris']
I don't understand why Paris, CA is first, 'cause there's so much more
"Paris" in the second one...
Anyway, is there any way to make the number of "my_query" terms appearance
make the difference ? Because with alternate names, there will be so much
much more Paris that it has te count.
Actually I think the array length matters in the scoring and I don't want
it to... I thought of a custom query score, but I don't think I'm able to
get the query term in the script query.
Any ideas ?
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/edddf66e-9553-479b-bb68-dfef8b2ba36b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.