photon icon indicating copy to clipboard operation
photon copied to clipboard

Returning weak partial matches

Open tommedema opened this issue 11 years ago • 8 comments

Sometimes one needs to do a geocoding lookup on an address that contains irrelevant data, such as an unknown condominium name. For example when searching for "Grand Parkview Asoke Unit 233/11 Sukhumvit 21" then none of the information is in OSM's database other than "Sukhumvit 21".

I would consider this an example of a weak partial match. For my use case, such irrelevant data needs to be ignored and therefore partial matches need to be returned too. E.g. http://photon.komoot.de/api/?q=grand%20parkview%20asoke%20sukhumvit%2021 should return the same as http://photon.komoot.de/api/?q=20sukhumvit%2021

Is it possible to perhaps add a score index to each returned feature, such that one can programatically detemrine if the result's score is high enough to be displayed? This varies by application.

tommedema avatar May 09 '14 17:05 tommedema

Any feedback on the feasibility of this request would be highly appreciated. :)

tommedema avatar May 14 '14 02:05 tommedema

It's feasible, quite easy in fact. After the sprint I'll let you know how to adjust the code.

christophlingg avatar May 14 '14 05:05 christophlingg

That's excellent. Combined with the extra administrative parameters and postal codes photon will be a huge improvement over Nominatim for my use case. I'm looking forward to the update.

tommedema avatar May 14 '14 12:05 tommedema

Any update about this after the sprint?

tommedema avatar Jun 08 '14 05:06 tommedema

We haven't finished polishing the elastic search config yet. But you can already modify the search queries for your needs. Check the minimal_should_match property.

christophlingg avatar Jun 08 '14 11:06 christophlingg

This would be nice but is it really possible to return a score/quality attribute for every result? If I remember from my old lucene knowledge the score number then are comparable to each other but are meaningless in an absolute sense and therefor hard to return a value e.g. from 0 (very bad match) to 1 (perfect match)

karussell avatar Aug 24 '15 08:08 karussell

Hi,

First of all thank you for this great library.

Do you have any update about this issue. I am facing the same problem when the zip codes in my address are not exactly matching the zip codes in Photon and give no geocoding result.

For example, I have this address in Canada:

http://photon.komoot.de/api/?q=320%20Lajoie%20St%20Ottawa,%20ON%20K1L%207H4

This is returning no result but when I remove the zip code:

http://photon.komoot.de/api/?q=320%20Lajoie%20St%20Ottawa

It is geocoded correctly.

I noticed that the parameter should_match can be used, but when I tried it , I still got no result. Correct me if I am wrong, but the default value is 1 right ? Using lower value doesn't change anything.

razafinr avatar Dec 07 '15 09:12 razafinr