{"action":"closed","number":1219,"pull_request":{"url":"https://api.github.com/repos/pelias/api/pulls/1219","id":225515644,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NTE1NjQ0","html_url":"https://github.com/pelias/api/pull/1219","diff_url":"https://github.com/pelias/api/pull/1219.diff","patch_url":"https://github.com/pelias/api/pull/1219.patch","issue_url":"https://api.github.com/repos/pelias/api/issues/1219","number":1219,"state":"closed","locked":false,"title":"feat(autocomplete): filter out address records for character counts below threshold","user":{"login":"missinglink","id":738069,"node_id":"MDQ6VXNlcjczODA2OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/738069?v=4","gravatar_id":"","url":"https://api.github.com/users/missinglink","html_url":"https://github.com/missinglink","followers_url":"https://api.github.com/users/missinglink/followers","following_url":"https://api.github.com/users/missinglink/following{/other_user}","gists_url":"https://api.github.com/users/missinglink/gists{/gist_id}","starred_url":"https://api.github.com/users/missinglink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missinglink/subscriptions","organizations_url":"https://api.github.com/users/missinglink/orgs","repos_url":"https://api.github.com/users/missinglink/repos","events_url":"https://api.github.com/users/missinglink/events{/privacy}","received_events_url":"https://api.github.com/users/missinglink/received_events","type":"User","site_admin":false},"body":"READY TO MERGE\r\n\r\n~~This PR will allow us to provide a negative layer filter so that autocomplete will not search on the `address` layer for one or two character inputs.~~\r\n\r\nAfter testing this I discovered that `must_not` conditions do not create a bitmask as `filter` conditions do, so what ends up happening is that the same amount of hits are returned and then an iterator is generated to run over the results of the `must` and enforce the `must_not`.\r\n\r\ntl;dr `must_not` is super slow for large hit counts and lots of people on the internet are complaining about how it's not very well implemented.\r\n\r\nSo I've rewritten the query to use a positive filter, we compute the difference between `all layers` and the `excluded layers`. Fortunately this is now super easy to do since the work I did a couple months back to clean up the `type_mapping` module :)\r\n\r\nWell covered with unit tests and fixtures, I played with it a bit on North America and couldn't see any real difference in perceived quality for one-or-two char inputs.\r\n\r\nThe effect of this will be a huge improvement in performance for one and two character queries, the address layer accounts for ~90% of matches.","created_at":"2018-10-24T19:04:02Z","updated_at":"2018-11-03T15:53:01Z","closed_at":"2018-11-03T15:53:01Z","merged_at":"2018-11-03T15:53:01Z","merge_commit_sha":"32c295d37243e81b93b17f93d7ab077c744d3ff4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pelias/api/pulls/1219/commits","review_comments_url":"https://api.github.com/repos/pelias/api/pulls/1219/comments","review_comment_url":"https://api.github.com/repos/pelias/api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pelias/api/issues/1219/comments","statuses_url":"https://api.github.com/repos/pelias/api/statuses/3c37e94aa65720d6f7ca672d88b1a77db3c8bfb5","head":{"label":"pelias:max_character_count_layer_filter","ref":"max_character_count_layer_filter","sha":"3c37e94aa65720d6f7ca672d88b1a77db3c8bfb5","user":{"login":"pelias","id":8240367,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNDAzNjc=","avatar_url":"https://avatars3.githubusercontent.com/u/8240367?v=4","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"repo":{"id":23627382,"node_id":"MDEwOlJlcG9zaXRvcnkyMzYyNzM4Mg==","name":"api","full_name":"pelias/api","private":false,"owner":{"login":"pelias","id":8240367,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNDAzNjc=","avatar_url":"https://avatars3.githubusercontent.com/u/8240367?v=4","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pelias/api","description":"HTTP API for Pelias Geocoder","fork":false,"url":"https://api.github.com/repos/pelias/api","forks_url":"https://api.github.com/repos/pelias/api/forks","keys_url":"https://api.github.com/repos/pelias/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pelias/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pelias/api/teams","hooks_url":"https://api.github.com/repos/pelias/api/hooks","issue_events_url":"https://api.github.com/repos/pelias/api/issues/events{/number}","events_url":"https://api.github.com/repos/pelias/api/events","assignees_url":"https://api.github.com/repos/pelias/api/assignees{/user}","branches_url":"https://api.github.com/repos/pelias/api/branches{/branch}","tags_url":"https://api.github.com/repos/pelias/api/tags","blobs_url":"https://api.github.com/repos/pelias/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pelias/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pelias/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/pelias/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pelias/api/statuses/{sha}","languages_url":"https://api.github.com/repos/pelias/api/languages","stargazers_url":"https://api.github.com/repos/pelias/api/stargazers","contributors_url":"https://api.github.com/repos/pelias/api/contributors","subscribers_url":"https://api.github.com/repos/pelias/api/subscribers","subscription_url":"https://api.github.com/repos/pelias/api/subscription","commits_url":"https://api.github.com/repos/pelias/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/pelias/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/pelias/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/pelias/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/pelias/api/contents/{+path}","compare_url":"https://api.github.com/repos/pelias/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pelias/api/merges","archive_url":"https://api.github.com/repos/pelias/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pelias/api/downloads","issues_url":"https://api.github.com/repos/pelias/api/issues{/number}","pulls_url":"https://api.github.com/repos/pelias/api/pulls{/number}","milestones_url":"https://api.github.com/repos/pelias/api/milestones{/number}","notifications_url":"https://api.github.com/repos/pelias/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pelias/api/labels{/name}","releases_url":"https://api.github.com/repos/pelias/api/releases{/id}","deployments_url":"https://api.github.com/repos/pelias/api/deployments","created_at":"2014-09-03T16:06:04Z","updated_at":"2018-11-03T15:10:47Z","pushed_at":"2018-11-03T15:53:01Z","git_url":"git://github.com/pelias/api.git","ssh_url":"git@github.com:pelias/api.git","clone_url":"https://github.com/pelias/api.git","svn_url":"https://github.com/pelias/api","homepage":"http://pelias.io","size":2858,"stargazers_count":93,"watchers_count":93,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":77,"open_issues":55,"watchers":93,"default_branch":"master"}},"base":{"label":"pelias:master","ref":"master","sha":"aae1d7db0ff6e8d8ed15f89409dd4aea882b8a9a","user":{"login":"pelias","id":8240367,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNDAzNjc=","avatar_url":"https://avatars3.githubusercontent.com/u/8240367?v=4","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"repo":{"id":23627382,"node_id":"MDEwOlJlcG9zaXRvcnkyMzYyNzM4Mg==","name":"api","full_name":"pelias/api","private":false,"owner":{"login":"pelias","id":8240367,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNDAzNjc=","avatar_url":"https://avatars3.githubusercontent.com/u/8240367?v=4","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pelias/api","description":"HTTP API for Pelias Geocoder","fork":false,"url":"https://api.github.com/repos/pelias/api","forks_url":"https://api.github.com/repos/pelias/api/forks","keys_url":"https://api.github.com/repos/pelias/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pelias/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pelias/api/teams","hooks_url":"https://api.github.com/repos/pelias/api/hooks","issue_events_url":"https://api.github.com/repos/pelias/api/issues/events{/number}","events_url":"https://api.github.com/repos/pelias/api/events","assignees_url":"https://api.github.com/repos/pelias/api/assignees{/user}","branches_url":"https://api.github.com/repos/pelias/api/branches{/branch}","tags_url":"https://api.github.com/repos/pelias/api/tags","blobs_url":"https://api.github.com/repos/pelias/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pelias/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pelias/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/pelias/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pelias/api/statuses/{sha}","languages_url":"https://api.github.com/repos/pelias/api/languages","stargazers_url":"https://api.github.com/repos/pelias/api/stargazers","contributors_url":"https://api.github.com/repos/pelias/api/contributors","subscribers_url":"https://api.github.com/repos/pelias/api/subscribers","subscription_url":"https://api.github.com/repos/pelias/api/subscription","commits_url":"https://api.github.com/repos/pelias/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/pelias/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/pelias/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/pelias/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/pelias/api/contents/{+path}","compare_url":"https://api.github.com/repos/pelias/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pelias/api/merges","archive_url":"https://api.github.com/repos/pelias/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pelias/api/downloads","issues_url":"https://api.github.com/repos/pelias/api/issues{/number}","pulls_url":"https://api.github.com/repos/pelias/api/pulls{/number}","milestones_url":"https://api.github.com/repos/pelias/api/milestones{/number}","notifications_url":"https://api.github.com/repos/pelias/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pelias/api/labels{/name}","releases_url":"https://api.github.com/repos/pelias/api/releases{/id}","deployments_url":"https://api.github.com/repos/pelias/api/deployments","created_at":"2014-09-03T16:06:04Z","updated_at":"2018-11-03T15:10:47Z","pushed_at":"2018-11-03T15:53:01Z","git_url":"git://github.com/pelias/api.git","ssh_url":"git@github.com:pelias/api.git","clone_url":"https://github.com/pelias/api.git","svn_url":"https://github.com/pelias/api","homepage":"http://pelias.io","size":2858,"stargazers_count":93,"watchers_count":93,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":77,"open_issues":55,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pelias/api/pulls/1219"},"html":{"href":"https://github.com/pelias/api/pull/1219"},"issue":{"href":"https://api.github.com/repos/pelias/api/issues/1219"},"comments":{"href":"https://api.github.com/repos/pelias/api/issues/1219/comments"},"review_comments":{"href":"https://api.github.com/repos/pelias/api/pulls/1219/comments"},"review_comment":{"href":"https://api.github.com/repos/pelias/api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pelias/api/pulls/1219/commits"},"statuses":{"href":"https://api.github.com/repos/pelias/api/statuses/3c37e94aa65720d6f7ca672d88b1a77db3c8bfb5"}},"author_association":"MEMBER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"orangejulius","id":111716,"node_id":"MDQ6VXNlcjExMTcxNg==","avatar_url":"https://avatars3.githubusercontent.com/u/111716?v=4","gravatar_id":"","url":"https://api.github.com/users/orangejulius","html_url":"https://github.com/orangejulius","followers_url":"https://api.github.com/users/orangejulius/followers","following_url":"https://api.github.com/users/orangejulius/following{/other_user}","gists_url":"https://api.github.com/users/orangejulius/gists{/gist_id}","starred_url":"https://api.github.com/users/orangejulius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangejulius/subscriptions","organizations_url":"https://api.github.com/users/orangejulius/orgs","repos_url":"https://api.github.com/users/orangejulius/repos","events_url":"https://api.github.com/users/orangejulius/events{/privacy}","received_events_url":"https://api.github.com/users/orangejulius/received_events","type":"User","site_admin":false},"comments":7,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":505,"deletions":17,"changed_files":11}}
{"actor":{"display_login":"orangejulius"}}