{"action":"created","issue":{"url":"https://api.github.com/repos/addok/addok/issues/492","repository_url":"https://api.github.com/repos/addok/addok","labels_url":"https://api.github.com/repos/addok/addok/issues/492/labels{/name}","comments_url":"https://api.github.com/repos/addok/addok/issues/492/comments","events_url":"https://api.github.com/repos/addok/addok/issues/492/events","html_url":"https://github.com/addok/addok/issues/492","id":359380775,"node_id":"MDU6SXNzdWUzNTkzODA3NzU=","number":492,"title":"How to configure addok to favour cities in autocomplete result ","user":{"login":"Flaburgan","id":930064,"node_id":"MDQ6VXNlcjkzMDA2NA==","avatar_url":"https://avatars1.githubusercontent.com/u/930064?v=4","gravatar_id":"","url":"https://api.github.com/users/Flaburgan","html_url":"https://github.com/Flaburgan","followers_url":"https://api.github.com/users/Flaburgan/followers","following_url":"https://api.github.com/users/Flaburgan/following{/other_user}","gists_url":"https://api.github.com/users/Flaburgan/gists{/gist_id}","starred_url":"https://api.github.com/users/Flaburgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flaburgan/subscriptions","organizations_url":"https://api.github.com/users/Flaburgan/orgs","repos_url":"https://api.github.com/users/Flaburgan/repos","events_url":"https://api.github.com/users/Flaburgan/events{/privacy}","received_events_url":"https://api.github.com/users/Flaburgan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-09-12T09:00:15Z","updated_at":"2018-09-12T16:09:03Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"First of all: thank you **very much** to provide such a nice project with an open licence like this.\r\n\r\nAt work, we're trying to replace Google Maps autocomplete using addok. With exact matches, the results are great, every addresses we tried are found. However, with autocompletion, the order and results are very different than the ones returned by Google Maps. We don't need to have the exact same results, but still, the current ones are not good enough for us with the default addok setting.\r\n\r\nFor example, when starting to type *\"Gre\"* or *\"Cham\"* I would expect big cities like Grenoble or Chambéry to at least appear in the dropdown. But actually, you need to go as far as *\"Grenob\"* or even *\"Chambér\"* to see them appear (and they now become the top result). These are the results on \r\nhttps://adresse.data.gouv.fr/map, I also reproduced it locally (no `FIELDS` set in the config file, `addok-france` and `addok-fr` plugins enabled).\r\n\r\nSo I started to try to tweak addok a bit, giving more importance to cities with:\r\n```\r\nFIELDS = [\r\n    {'key': 'name'},\r\n    {'key': 'street'},\r\n    {'key': 'postcode',\r\n     'boost': lambda doc: 1.2 if doc.get('type') == 'commune' else 1},\r\n    {'key': 'city','boost': lambda doc: 8 if doc.get('type') == 'municipality' else 1},\r\n    {'key': 'housenumbers'}\r\n]\r\n```\r\n\r\nSo, when the document type is `municipality`, boost the city key match. Unfortunately, this didn't change very much:\r\n\r\n```\r\n> EXPLAIN gre\r\n[7.106] Taken tokens: [<Token gr>]\r\n[7.112] Common tokens: []\r\n[7.114] Housenumbers token: []\r\n[7.116] Not found tokens: []\r\n[7.118] Filters: []\r\n[7.122] ** ONLY_COMMONS_BUT_GEOHASH_TRY_AUTOCOMPLETE_COLLECTOR **\r\n[7.126] ** NO_TOKENS_BUT_HOUSENUMBERS_AND_GEOHASH **\r\n[7.128] ** NO_AVAILABLE_TOKENS_ABORT **\r\n[7.129] ** ONLY_COMMONS **\r\n[7.133] ** NO_MEANINGFUL_BUT_COMMON_TRY_AUTOCOMPLETE_COLLECTOR **\r\n[7.135] ** ONLY_COMMONS_TRY_AUTOCOMPLETE_COLLECTOR **\r\n[7.137] ** BUCKET_WITH_MEANINGFUL **\r\n[7.143] New bucket with keys ['w|gr'] and limit 10\r\n[7.290] 10 ids in bucket so far\r\n[7.298] New bucket with keys ['w|gr'] and limit 0\r\n[7.463] 100 ids in bucket so far\r\n[7.468] ** REDUCE_WITH_OTHER_COMMONS **\r\n[7.472] ** ENSURE_GEOHASH_RESULTS_ARE_INCLUDED_IF_CENTER_IS_GIVEN **\r\n[7.477] ** FUZZY_COLLECTOR **\r\n[7.483] ** AUTOCOMPLETE_MEANINGFUL_COLLECTOR **\r\n[7.485] ** EXTEND_RESULTS_REDUCING_TOKENS **\r\n[7.490] ** EXTEND_RESULTS_EXTRAPOLING_RELATIONS **\r\n[7.496] Computing results\r\n[7.509] Done getting results data\r\n[19.77] Done computing results\r\nGres Nord 84430 Mondragon (ZEwBR | str_distance: 0.9/1.0, importance: 0.0044/0.1)\r\nGres Sud 84430 Mondragon (lWvor | str_distance: 0.9/1.0, importance: 0.0035/0.1)\r\nGres 83470 Pourcieux (wqPz8 | str_distance: 0.9/1.0, importance: 0.0008/0.1)\r\nGre 38570 Theys (V04wM | str_distance: 0.9/1.0, importance: 0.0007/0.1)\r\nGres 82400 Saint-Vincent-Lespinasse (Z9Mzg | str_distance: 0.9/1.0, importance: 0.0003/0.1)\r\nGres 47230 Xaintrailles (B9ZAX | str_distance: 0.9/1.0, importance: 0.0002/0.1)\r\nGres 30700 Flaux (193RG | str_distance: 0.9/1.0, importance: 0.0002/0.1)\r\nGres 82190 Brassac (m99xO | str_distance: 0.9/1.0, importance: 0.0002/0.1)\r\nLes Gres 83400 Hyères (pj4yp | str_distance: 0.7/1.0, importance: 0.0149/0.1)\r\nLes Gres 83610 Collobrières (n9wxD | str_distance: 0.7/1.0, importance: 0.0132/0.1)\r\n```\r\n\r\nIt looks like we're here in a case where the `addok-fr` plugin adds a final `s` to the `gre` input and so find a perfect match with `Gres`, even if `Mondragon` is a very small city. This can be linked to the https://github.com/addok/addok/issues/465 problem (see my comment about `pontcharra` there).\r\n\r\nSo I went ahead and tried with `addok-fr` disabled. There, the results change and the bucket is way more interesting:\r\n\r\n```\r\nEXPLAIN gre\r\n[6.838] Taken tokens: [<Token gre>]\r\n[6.859] Common tokens: []\r\n[6.867] Housenumbers token: []\r\n[6.873] Not found tokens: []\r\n[6.882] Filters: []\r\n[6.897] ** ONLY_COMMONS_BUT_GEOHASH_TRY_AUTOCOMPLETE_COLLECTOR **\r\n[6.908] ** NO_TOKENS_BUT_HOUSENUMBERS_AND_GEOHASH **\r\n[6.916] ** NO_AVAILABLE_TOKENS_ABORT **\r\n[6.923] ** ONLY_COMMONS **\r\n[6.934] ** NO_MEANINGFUL_BUT_COMMON_TRY_AUTOCOMPLETE_COLLECTOR **\r\n[6.942] ** ONLY_COMMONS_TRY_AUTOCOMPLETE_COLLECTOR **\r\n[6.950] ** BUCKET_WITH_MEANINGFUL **\r\n[6.971] New bucket with keys ['w|gre'] and limit 10\r\n[7.313] 10 ids in bucket so far\r\n[7.337] New bucket with keys ['w|gre'] and limit 0\r\n[7.594] 53 ids in bucket so far\r\n[7.608] ** REDUCE_WITH_OTHER_COMMONS **\r\n[7.621] ** ENSURE_GEOHASH_RESULTS_ARE_INCLUDED_IF_CENTER_IS_GIVEN **\r\n[7.637] ** FUZZY_COLLECTOR **\r\n[7.655] ** AUTOCOMPLETE_MEANINGFUL_COLLECTOR **\r\n[7.669] Autocompleting gre\r\n[8.990] Found tokens to autocomplete {b'grennes', b'grenadieres', b'grenouilhac', b'grepatiere', b'gremier', b'grevin', b'grenetiot', b'gremonval', b'greuillat', b'grelaud', b'grendelbruch', b'grechons', b'grelinger', b'grenadines', b'grelaudiere', b'grenteries', b'grepilles', b'grevet', b'gresilliere', b'grenzhausen', b'grezolette', b'grezeaux', b'gregere', b'greffeliere', b'grenetterie', b'greniecq', b'greny', b'grenausiere', b'grenouillais', b'greenbach', b'greziere', b'grenons', b'grenetemy', b'gregoriere', b'grerau', b'gressignan', b'grezes', b'grenier', b'gresieres', b'grelieries', b'gresswiller', b'grechous', b'greuses', b'grenely', b'grenel', b'grebaut', b'grenochere', b'grebaudiere', b'greugne', b'gregaudie', b'gressaure', b'gresin', b'greaumes', b'greppet', b'grenouilleaux', b'gregousse', b'greneta', b'grenouillots', b'gretoux', b'gregis', b'grevottes', b'gressiens', b'grevillers', b'grenouilles', b'greffes', b'grety', b'gremgi', b'grezalou', b'gresy', b'grellets', b'great', b'gredins', b'grebault', b'gredelier', b'gresourieres', b'gresly', b'greneux', b'grelauderie', b'greppel', b'grenadine', b'grenaudes', b'grelerais', b'grenuziere', b'gresot', b'gretias', b'grenouilloux', b'grenand', b'greo', b'greley', b'gregan', b'grezillonnais', b'grenieux', b'grezigne', b'grevinerie', b'grelonnerie', b'grehais', b'grebottes', b'greteau', b'grenouillettes', b'greno', b'grenaudie', b'greminieres', b'greviers', b'grevinieres', b'gresat', b'gresiliere', b'grette', b'greenwich', b'grezotte', b'grenouillees', b'grebenstein', b'greff', b'gregottier', b'gresaille', b'greyreau', b'greziat', b'grele', b'grevisse', b'grebusson', b'grenuzele', b'greciette', b'gresillieres', b'gremain', b'grentheville', b'grefumiere', b'grepille', b'gresol', b'gresles', b'grenebo', b'greland', b'grellety', b'greslieu', b'gresivaudan', b'grein', b'gresiecq', b'grelard', b'greverie', b'gresigne', b'gregoirais', b'greffuel', b'grevillieres', b'grezin', b'grenne', b'grennons', b'grenicheux', b'greze', b'grentemesnil', b'greniat', b'grenouilla', b'gretot', b'grelot', b'grescs', b'grezou', b'greyffie', b'green', b'grello', b'grepillieres', b'grenapin', b'grenettes', b'gresignac', b'greuil', b'grelateau', b'grettery', b'gregaou', b'gregh', b'greonais', b'greylas', b'grempill', b'gresard', b'gremeu', b'gretel', b'grelen', b'gremont', b'gredilles', b'greffiere', b'grepoul', b'grelin', b'greucourt', b'grellois', b'grelles', b'grenouilliers', b'grezal', b'gresillonnais', b'greolieres', b'gresasses', b'gregoire', b'gressan', b'gresilieres', b'gresspfad', b'gresie', b'grediers', b'gree', b'gressard', b'grenouliere', b'gretaudais', b'grejouls', b'grelann', b'gregoree', b'gressalerie', b'grepon', b'greensboro', b'greffeillet', b'greziolles', b'greillot', b'grehaigne', b'grentiere', b'grenadins', b'grebauval', b'gredes', b'greget', b'greviat', b'grejoles', b'grehinais', b'grenardiere', b'grevelynghe', b'grenadiere', b'gresilmont', b'gremoulet', b'grenerettes', b'grenouillit', b'greslerie', b'grevoulet', b'gresilley', b'grezolles', b'greherie', b'grepe', b'gremendiere', b'grelots', b'grelodiere', b'gremenousas', b'grenelliere', b'greienn', b'grenetiere', b'grec', b'grelons', b'grezillac', b'gretillat', b'gresse', b'gressac', b'gressun', b'grepillonnes', b'greneau', b'grenet', b'greuzard', b'gresoud', b'grelaut', b'grenalon', b'grendel', b'gresillot', b'grenod', b'grelliere', b'grezillieres', b'greneyren', b'greysolon', b'greises', b'greyres', b'greles', b'grelieres', b'grenard', b'grelets', b'grezeille', b'greliers', b'grestain', b'grenouilly', b'greignac', b'gregam', b'grellerie', b'gressieres', b'grenay', b'grenaiterie', b'gremillets', b'gretay', b'grenaldes', b'greyfie', b'grenois', b'gredo', b'gregiere', b'grecaou', b'gregeotte', b'grenadier', b'grellet', b'grenas', b'greois', b'greazerie', b'grelandieres', b'grezilles', b'greliche', b'grenone', b'gremiere', b'gregues', b'gremon', b'greoux', b'gresils', b'grenedan', b'gresilles', b'gregaume', b'grelouze', b'grenouillerie', b'grevoul', b'grenoberie', b'grelode', b'gresillere', b'greniot', b'gregogna', b'grenory', b'gremys', b'gresaux', b'grelorier', b'grelichon', b'gretrys', b'grelonges', b'grehen', b'grenetie', b'greleraie', b'grezelongue', b'grepin', b'greffets', b'gresliers', b'grefeille', b'grelos', b'greches', b'grezie', b'grebilles', b'greyseaux', b'greslard', b'greppan', b'gremonnerie', b'grelous', b'grebe', b'grean', b'greillon', b'gredisans', b'gregossieres', b'grevets', b'gremillere', b'greyter', b'grelottiere', b'grelon', b'gresigny', b'grenollerie', b'grengelberg', b'greolle', b'greso', b'grellieres', b'grebier', b'grenoisiere', b'grenal', b'greil', b'grelumiere', b'grenord', b'greffons', b'grezille', b'greys', b'greniere', b'gressey', b'grepilliere', b'greds', b'grezoles', b'greullier', b'greandaie', b'grenerie', b'grehondiere', b'grezoilles', b'grelac', b'grezys', b'grenail', b'greez', b'grefeuille', b'greneziere', b'gretais', b'grelerie', b'gretes', b'grevel', b'grecque', b'greitte', b'grenilloux', b'greoune', b'gregal', b'greserie', b'gressiere', b'gremets', b'grenouillis', b'gresmont', b'grellec', b'gressiez', b'gremecey', b'grenouillers', b'grepillon', b'grelines', b'grevelons', b'gremonds', b'gregniou', b'gremellerie', b'grenant', b'grenelle', b'grelettes', b'greterie', b'greval', b'gressette', b'gregoules', b'gremeaux', b'grelardon', b'gressentis', b'grelo', b'greille', b'grelaz', b'greu', b'greleyres', b'grelaudieres', b'gresson', b'grelottieres', b'grebillon', b'greneriers', b'grezieux', b'gresios', b'greciet', b'greissiers', b'grelehais', b'grenon', b'grees', b'grevellec', b'grevillot', b'greviere', b'gresines', b'grelonnes', b'grechez', b'gresifaing', b'gressins', b'greve', b'grenels', b'gregale', b'grelande', b'grebbes', b'greau', b'grenese', b'grepins', b'greneville', b'gremi', b'grezemange', b'gressin', b'grezel', b'gremontmesnil', b'greard', b'gretu', b'grech', b'grenoniere', b'gremion', b'grezil', b'greffulhe', b'grenusse', b'greffot', b'gregory', b'greniettes', b'grelozet', b'greffins', b'grelandier', b'gremel', b'gressoux', b'gretteguerre', b'greset', b'grezan', b'gretaude', b'greges', b'greffet', b'greffut', b'grenonvilliers', b'grenot', b'greffuhle', b'gresouillere', b'greffeil', b'grener', b'grete', b'grezas', b'grellue', b'grenetiers', b'grebefosse', b'grendelbach', b'grenouilleau', b'grepesiere', b'gremone', b'grenebile', b'grenie', b'grelanges', b'grezaudoux', b'gretz', b'greens', b'grea', b'greuillotte', b'greuh', b'grepissot', b'greliere', b'grenairie', b'gremies', b'greunvaen', b'grezerie', b'grellon', b'grenardieres', b'grenadilles', b'grenouilliere', b'greardiere', b'grevilly', b'grellou', b'gressonniere', b'grelis', b'gresou', b'grenotte', b'grehant', b'gresine', b'greiche', b'grenaizieres', b'gresq', b'grelu', b'greite', b'grezals', b'grenoulhac', b'grevy', b'grenouilloy', b'gregoirie', b'greaux', b'gremillot', b'grezeau', b'greolon', b'greignon', b'gremillon', b'gremenet', b'grere', b'grenetier', b'gren', b'greses', b'greien', b'greverend', b'grenchen', b'greuille', b'greousse', b'gremoi', b'grezignac', b'grenarderie', b'greneze', b'greziecq', b'grepissard', b'gresil', b'greusards', b'greux', b'greppes', b'grene', b'grenouillats', b'gregorio', b'gredely', b'grego', b'gredon', b'gredellerie', b'greta', b'gredouillere', b'grenaudaie', b'grenouillets', b'grenassouper', b'grezieu', b'grels', b'greffas', b'grenberg', b'greseliere', b'gressets', b'gremons', b'greube', b'gremange', b'grezet', b'grenaires', b'grennerie', b'gresigo', b'gremevillers', b'grelveau', b'grezelou', b'grelette', b'grese', b'grela', b'gregaule', b'grenette', b'grenaudiere', b'gremonville', b'grepiac', b'grenaude', b'grenaudio', b'greca', b'grehetiere', b'grezillere', b'greffeuille', b'grezaillas', b'grenobin', b'grenonniere', b'grenaudieres', b'grevat', b'grets', b'grenit', b'grenache', b'greysac', b'grel', b'greleterie', b'greouces', b'gressiots', b'gredolles', b'grenarie', b'greyere', b'grecy', b'greffiers', b'gremoin', b'grevesacq', b'greluchons', b'greulerie', b'grellin', b'greffions', b'gregaine', b'grelou', b'grenailleres', b'gregu', b'grecs', b'grening', b'greement', b'greniers', b'greiz', b'grezelets', b'grenadie', b'grenlat', b'gremonpre', b'gresieux', b'grezaou', b'grettais', b'grebinfaing', b'grettes', b'grenadan', b'greyzeaux', b'gresardieres', b'grezalet', b'grevileas', b'greygnac', b'grenneville', b'grehallet', b'greysard', b'gregot', b'gressier', b'grezenghon', b'gressaudiere', b'gregori', b'grechouet', b'gremairie', b'grezier', b'greffeurs', b'gresal', b'gregorie', b'greban', b'grenterie', b'grechamp', b'grenaudais', b'grenoux', b'greleyre', b'gresa', b'grelez', b'grevees', b'gresle', b'grelle', b'grelinge', b'grezette', b'grenery', b'gremonmenil', b'grenisses', b'grerie', b'grelinche', b'greffere', b'greneaux', b'grenairon', b'gresinette', b'gredeux', b'grenepret', b'grezere', b'grez', b'grenouville', b'grenouze', b'grenadette', b'grelards', b'greverats', b'grelonne', b'grente', b'grenadin', b'grenottes', b'grenadelles', b'grenaly', b'greleix', b'grentiniere', b'gremillet', b'grelins', b'grevelle', b'gresillas', b'greppe', b'grelaie', b'gremilly', b'grezelle', b'grelotteries', b'grelie', b'grenelles', b'greffe', b'grenieuseville', b'gremouchere', b'greveaux', b'gremian', b'grelayere', b'greliniere', b'grelettrie', b'grehando', b'greppy', b'grenodieres', b'greure', b'gref', b'grezaudie', b'greche', b'grebiay', b'greloux', b'gregatieres', b'greppi', b'grebes', b'greffines', b'greletti', b'greslands', b'grevey', b'greene', b'gremifontaine', b'greppets', b'grenouilloires', b'greenwood', b'gresillonnaie', b'greleau', b'greaume', b'gresaut', b'greollerie', b'grenouilleres', b'grehan', b'grebadis', b'grenalvestre', b'greco', b'grefouline', b'grellier', b'gresole', b'grelatterie', b'greson', b'grenailles', b'gregy', b'grenouillat', b'grezac', b'grelinette', b'gremichon', b'grezelles', b'gressy', b'gregue', b'gredolle', b'gregny', b'grenaux', b'grenouillon', b'greneraye', b'grebeaux', b'gregoires', b'gremare', b'grelauds', b'greffaud', b'greineries', b'grenalere', b'grefferie', b'grenive', b'greville', b'grescans', b'grenoulliers', b'grejan', b'gredy', b'gremaz', b'gresies', b'grenthe', b'grelettiere', b'grenatiere', b'gresille', b'grebon', b'gresserie', b'grezelon', b'grenouillette', b'greferie', b'greuville', b'grenets', b'grezard', b'grevarin', b'greffier', b'gresas', b'grenats', b'grentzingen', b'gressaye', b'grevenmacher', b'greheu', b'grevillou', b'grenou', b'gresley', b'grenouill', b'grebinfing', b'greements', b'grelay', b'grecu', b'gressionnais', b'greletiere', b'gremis', b'greye', b'gremediere', b'greaud', b'grenouillieres', b'grevoirin', b'grevilleas', b'greeurs', b'grepelin', b'grenils', b'grezelade', b'grelet', b'gredinerie', b'gresillon', b'greant', b'greluret', b'grenil', b'greiner', b'greix', b'gressot', b'gresillonniere', b'grebelin', b'greasque', b'grenonne', b'gredenville', b'grevettes', b'grevillons', b'greves', b'greneveau', b'grements', b'gresillou', b'gresses', b'gresouliere', b'greven', b'gremond', b'greollier', b'grenaud', b'gresals', b'gresau', b'grelats', b'grelier', b'gresillons', b'grelliers', b'greyen', b'grechac', b'grenatieres', b'grenesey', b'greugnons', b'grenouiller', b'grennevo', b'grenellerie', b'grezotiere', b'grellarderie', b'greuet', b'gresland', b'gressee', b'gressart', b'grezillon', b'gremie', b'gremil', b'greslin', b'greoure', b'gremey', b'grenais', b'grelodots', b'grenasserie', b'grellery', b'gressweg', b'grezillas', b'grelat', b'grediere', b'greffieres', b'grevots', b'greffon', b'grenaches', b'gredaines', b'grezous', b'gregor', b'grenu', b'grens', b'gregoiriere', b'grenotiere', b'grenouillard', b'greusard', b'grely', b'grezellie', b'grenouillet', b'greleries', b'grelandiere', b'grebau', b'grennetiere', b'greziers', b'grezettes', b'grelepoix', b'greurie', b'gregueuil', b'gresillais', b'grebies', b'gredaziere', b'greneuc', b'grelotterie', b'grenouilleries', b'greuse', b'grescoux', b'gretry', b'grenn', b'grelee', b'gremille', b'greneterie', b'grentzinger', b'gremeau', b'grenauderie', b'grevou', b'gremelle', b'greenock', b'grenaize', b'grelintieres', b'grenat', b'grebert', b'gressenbucher', b'grenetieres', b'grenaliere', b'grenaille', b'gressaille', b'greoudelieres', b'grelettier', b'gressonnieres', b'greulardais', b'grelliets', b'grenis', b'grefrath', b'greerie', b'gresset', b'greber', b'greppot', b'greudiere', b'grezian', b'greodiere', b'grey', b'grenaudrie', b'greseaux', b'greulie', b'grealou', b'grenottiere', b'grezatte', b'grenettiere', b'greou', b'gremelieres', b'grenade', b'grelone', b'greuzardiere', b'greugelerie', b'gresiere', b'gresaud', b'gremillerie', b'grece', b'grezay', b'grelechere', b'grehandiere', b'grelarie', b'gres', b'grelades', b'greoulou', b'grezels', b'greletteries', b'grenouille', b'grebey', b'grevieres', b'grecourt', b'gresseras', b'grepis', b'gremondiere', b'gretoulette', b'grenoble', b'greuze', b'grechoux', b'grezans', b'greho', b'grechot', b'greneraie', b'gregaudiere', b'grenades', b'greletterie', b'grediniere', b'greavo', b'grenadiers', b'grenieres', b'grellot', b'greytus', b'gregau', b'grenots', b'gressue', b'grenaderie', b'gretays', b'greppaz', b'grehandais', b'grelymene', b'grenouillere', b'grepillons', b'gresalles', b'grevaux', b'gregnolets', b'greal', b'greffoir', b'greubaz', b'greffiniere', b'gredat', b'gredtwiese', b'greffallerie'}\r\n[9.019] Trying to extend bucket. Autocomplete w|grennes\r\n[9.037] Adding to bucket with keys ['w|grennes']\r\n[9.358] 54 ids in bucket so far\r\n[9.383] Trying to extend bucket. Autocomplete w|grenadieres\r\n[9.396] Adding to bucket with keys ['w|grenadieres']\r\n[9.713] 57 ids in bucket so far\r\n[9.738] Trying to extend bucket. Autocomplete w|grenouilhac\r\n[9.750] Adding to bucket with keys ['w|grenouilhac']\r\n[9.996] 58 ids in bucket so far\r\n[10.01] Trying to extend bucket. Autocomplete w|grepatiere\r\n[10.02] Adding to bucket with keys ['w|grepatiere']\r\n[10.22] 60 ids in bucket so far\r\n[10.24] Trying to extend bucket. Autocomplete w|gremier\r\n[10.25] Adding to bucket with keys ['w|gremier']\r\n[10.44] 62 ids in bucket so far\r\n[10.47] Trying to extend bucket. Autocomplete w|grevin\r\n[10.48] Adding to bucket with keys ['w|grevin']\r\n[10.68] 78 ids in bucket so far\r\n[10.70] Trying to extend bucket. Autocomplete w|grenetiot\r\n[10.71] Adding to bucket with keys ['w|grenetiot']\r\n[10.90] 79 ids in bucket so far\r\n[10.92] Trying to extend bucket. Autocomplete w|gremonval\r\n[10.93] Adding to bucket with keys ['w|gremonval']\r\n[11.13] 80 ids in bucket so far\r\n[11.15] Trying to extend bucket. Autocomplete w|greuillat\r\n[11.16] Adding to bucket with keys ['w|greuillat']\r\n[11.35] 81 ids in bucket so far\r\n[11.37] Trying to extend bucket. Autocomplete w|grelaud\r\n[11.38] Adding to bucket with keys ['w|grelaud']\r\n[11.58] 90 ids in bucket so far\r\n[11.60] Trying to extend bucket. Autocomplete w|grendelbruch\r\n[11.61] Adding to bucket with keys ['w|grendelbruch']\r\n[11.82] 100 ids in bucket so far\r\n[14.56] ** EXTEND_RESULTS_REDUCING_TOKENS **\r\n[14.57] ** EXTEND_RESULTS_EXTRAPOLING_RELATIONS **\r\n[14.59] Computing results\r\n[14.62] Done getting results data\r\n[43.68] Done computing results\r\nGrendelbruch (WlBwo | str_distance: 0.9/1.0, importance: 0.0075/0.1)\r\nGrenouilhac 48700 Saint-Amans (WoGBg | str_distance: 0.9/1.0, importance: 0.007/0.1)\r\nGrelaud 24370 Calviac-en-Périgord (OPPKQ | str_distance: 0.9/1.0, importance: 0.0009/0.1)\r\nGre 38570 Theys (K5M5J | str_distance: 0.9/1.0, importance: 0.0007/0.1)\r\nGreuillat 36340 Cluis (pXY3N | str_distance: 0.9/1.0, importance: 0.0005/0.1)\r\nGREMIER 39800 Brainans (qDRZy | str_distance: 0.9/1.0, importance: 0.0001/0.1)\r\nCité au Gre du Vent 80090 Amiens (Ymogp | str_distance: 0.7/1.0, importance: 0.036/0.1)\r\nRue Élie Gre 30000 Nîmes (JP1jD | str_distance: 0.7/1.0, importance: 0.0302/0.1)\r\nRue Grelaud 17100 Saintes (q7rWG | str_distance: 0.7/1.0, importance: 0.0243/0.1)\r\nImpasse Bon Gre Mal Gre 33000 Bordeaux (YQm6W | str_distance: 0.7/1.0, importance: 0.0243/0.1)\r\n44.2 ms — 1 run(s) — 10 results\r\n```\r\n\r\nGrenoble is far, but it's in the bucket list. I need to know more about how results are ordered though. Is it not returned even if it's a city because the matches are done first, then the list is truncated to the 10 top results, and then only at this step the importance I defined in FIELDS is used to order them? Or is it  used from the beginning to find the matches? If so, then why street are still in front of cities?\r\n\r\nAlso, the BAN contains the `population`, `adm_weight` and `importance` properties. I thought they were already taken into account. Maybe it can be boosted too?\r\n\r\nOr, if I sum up in one question, how can I be closer to Google Map autocomplete behaviour?\r\n\r\ncc @pascalheraud and @mat-chartier if you want to follow that discussion\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/addok/addok/issues/comments/420706076","html_url":"https://github.com/addok/addok/issues/492#issuecomment-420706076","issue_url":"https://api.github.com/repos/addok/addok/issues/492","id":420706076,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDcwNjA3Ng==","user":{"login":"YoannRonat","id":11463011,"node_id":"MDQ6VXNlcjExNDYzMDEx","avatar_url":"https://avatars1.githubusercontent.com/u/11463011?v=4","gravatar_id":"","url":"https://api.github.com/users/YoannRonat","html_url":"https://github.com/YoannRonat","followers_url":"https://api.github.com/users/YoannRonat/followers","following_url":"https://api.github.com/users/YoannRonat/following{/other_user}","gists_url":"https://api.github.com/users/YoannRonat/gists{/gist_id}","starred_url":"https://api.github.com/users/YoannRonat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YoannRonat/subscriptions","organizations_url":"https://api.github.com/users/YoannRonat/orgs","repos_url":"https://api.github.com/users/YoannRonat/repos","events_url":"https://api.github.com/users/YoannRonat/events{/privacy}","received_events_url":"https://api.github.com/users/YoannRonat/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T16:09:03Z","updated_at":"2018-09-12T16:09:03Z","author_association":"NONE","body":"Pour être précis la requête se fait par rapport au label qui est généré dans la fonction addok_france.make_labels.\r\nSi l'adresse est de type municipality, la recherche se fait bien par rapport aux champs name, postcode (si non nul) et city (si non nul et différent de name).\r\nChanger l'importance des documents de ville ne fait pas remonter Grenoble ? Tu peux avoir plus de vision en utilisant le paramètre LIMIT."}}
{"actor":{"display_login":"YoannRonat"}}