{"action":"closed","number":14,"pull_request":{"url":"https://api.github.com/repos/mapbox/carmen-cache/pulls/14","id":30816145,"html_url":"https://github.com/mapbox/carmen-cache/pull/14","diff_url":"https://github.com/mapbox/carmen-cache/pull/14.diff","patch_url":"https://github.com/mapbox/carmen-cache/pull/14.patch","issue_url":"https://api.github.com/repos/mapbox/carmen-cache/issues/14","number":14,"state":"closed","locked":false,"title":"Repeated neighbor term phraseRelev fix","user":{"login":"yhahn","id":83384,"avatar_url":"https://avatars.githubusercontent.com/u/83384?v=3","gravatar_id":"","url":"https://api.github.com/users/yhahn","html_url":"https://github.com/yhahn","followers_url":"https://api.github.com/users/yhahn/followers","following_url":"https://api.github.com/users/yhahn/following{/other_user}","gists_url":"https://api.github.com/users/yhahn/gists{/gist_id}","starred_url":"https://api.github.com/users/yhahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhahn/subscriptions","organizations_url":"https://api.github.com/users/yhahn/orgs","repos_url":"https://api.github.com/users/yhahn/repos","events_url":"https://api.github.com/users/yhahn/events{/privacy}","received_events_url":"https://api.github.com/users/yhahn/received_events","type":"User","site_admin":false},"body":"            0     1  2  3\r\n    query:  queen st st john\r\n    phrase:       st    john\r\n\r\nCurrently, the relev for this phrase is calculated to be < 1 because it short circuits at the first `st` match. When the loop gets to john@3 it's found to be non-contiguous with the previous match for st@1.\r\n\r\nThe fix in this branch ditches using queryidx/lastidx (which only represents the index of the *first* occurrence of a term in a query) and instead looks for overlap between termmasks:\r\n\r\n            0     1  2  3\r\n    query:  queen st st john\r\n\r\n    # masks go from RTL\r\n\r\n    mask st:    0110\r\n    mask john:  1000\r\n\r\nWhen looking at `john`, the previous matched term's mask for `st` is shifted to the left 1 and &'d to find overlaps:\r\n\r\n    mask st:    1100 <= shifted 1 bit to the left\r\n    mask john:  1000\r\n\r\n### Caveats\r\n\r\nThis approach leaves open the possibility of corner cases like this:\r\n\r\n    query:  A B D B C\r\n    phrase: A B C\r\n\r\n    A is next to B and\r\n    B is next to C but\r\n    there is no contiguous occurrence of A B C\r\n\r\nI'm ok with this for now -- let's burn that bridge if we ever get there.\r\n\r\n### Next actions\r\n\r\n- [x] Testing IRL\r\n- [x] Merge and gogogo\r\n\r\ncc @ingalls @sbma44 @karenzshea\r\n\r\n------\r\n\r\n*Why chopsticks? https://www.youtube.com/watch?v=DtvNAQ8KOqI*","created_at":"2015-03-10T01:38:36Z","updated_at":"2015-03-10T03:43:10Z","closed_at":"2015-03-10T03:43:10Z","merged_at":"2015-03-10T03:43:10Z","merge_commit_sha":"bef8480460a360413da1a47fdcfc19e6b52d0b12","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/carmen-cache/pulls/14/commits","review_comments_url":"https://api.github.com/repos/mapbox/carmen-cache/pulls/14/comments","review_comment_url":"https://api.github.com/repos/mapbox/carmen-cache/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/carmen-cache/issues/14/comments","statuses_url":"https://api.github.com/repos/mapbox/carmen-cache/statuses/c45eb9f17dd7b9f889135836af837c320ded55c3","head":{"label":"mapbox:chopsticks","ref":"chopsticks","sha":"c45eb9f17dd7b9f889135836af837c320ded55c3","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":18359582,"name":"carmen-cache","full_name":"mapbox/carmen-cache","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/carmen-cache","description":"C++ protobuf cache used by carmen","fork":false,"url":"https://api.github.com/repos/mapbox/carmen-cache","forks_url":"https://api.github.com/repos/mapbox/carmen-cache/forks","keys_url":"https://api.github.com/repos/mapbox/carmen-cache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/carmen-cache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/carmen-cache/teams","hooks_url":"https://api.github.com/repos/mapbox/carmen-cache/hooks","issue_events_url":"https://api.github.com/repos/mapbox/carmen-cache/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/carmen-cache/events","assignees_url":"https://api.github.com/repos/mapbox/carmen-cache/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/carmen-cache/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/carmen-cache/tags","blobs_url":"https://api.github.com/repos/mapbox/carmen-cache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/carmen-cache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/carmen-cache/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/carmen-cache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/carmen-cache/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/carmen-cache/languages","stargazers_url":"https://api.github.com/repos/mapbox/carmen-cache/stargazers","contributors_url":"https://api.github.com/repos/mapbox/carmen-cache/contributors","subscribers_url":"https://api.github.com/repos/mapbox/carmen-cache/subscribers","subscription_url":"https://api.github.com/repos/mapbox/carmen-cache/subscription","commits_url":"https://api.github.com/repos/mapbox/carmen-cache/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/carmen-cache/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/carmen-cache/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/carmen-cache/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/carmen-cache/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/carmen-cache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/carmen-cache/merges","archive_url":"https://api.github.com/repos/mapbox/carmen-cache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/carmen-cache/downloads","issues_url":"https://api.github.com/repos/mapbox/carmen-cache/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/carmen-cache/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/carmen-cache/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/carmen-cache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/carmen-cache/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/carmen-cache/releases{/id}","created_at":"2014-04-02T08:27:40Z","updated_at":"2015-02-26T21:35:51Z","pushed_at":"2015-03-10T03:43:10Z","git_url":"git://github.com/mapbox/carmen-cache.git","ssh_url":"git@github.com:mapbox/carmen-cache.git","clone_url":"https://github.com/mapbox/carmen-cache.git","svn_url":"https://github.com/mapbox/carmen-cache","homepage":null,"size":1482,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapbox:master","ref":"master","sha":"20644adff127a1cc4202be0fe89f52f630c948f8","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":18359582,"name":"carmen-cache","full_name":"mapbox/carmen-cache","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/carmen-cache","description":"C++ protobuf cache used by carmen","fork":false,"url":"https://api.github.com/repos/mapbox/carmen-cache","forks_url":"https://api.github.com/repos/mapbox/carmen-cache/forks","keys_url":"https://api.github.com/repos/mapbox/carmen-cache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/carmen-cache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/carmen-cache/teams","hooks_url":"https://api.github.com/repos/mapbox/carmen-cache/hooks","issue_events_url":"https://api.github.com/repos/mapbox/carmen-cache/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/carmen-cache/events","assignees_url":"https://api.github.com/repos/mapbox/carmen-cache/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/carmen-cache/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/carmen-cache/tags","blobs_url":"https://api.github.com/repos/mapbox/carmen-cache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/carmen-cache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/carmen-cache/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/carmen-cache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/carmen-cache/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/carmen-cache/languages","stargazers_url":"https://api.github.com/repos/mapbox/carmen-cache/stargazers","contributors_url":"https://api.github.com/repos/mapbox/carmen-cache/contributors","subscribers_url":"https://api.github.com/repos/mapbox/carmen-cache/subscribers","subscription_url":"https://api.github.com/repos/mapbox/carmen-cache/subscription","commits_url":"https://api.github.com/repos/mapbox/carmen-cache/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/carmen-cache/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/carmen-cache/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/carmen-cache/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/carmen-cache/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/carmen-cache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/carmen-cache/merges","archive_url":"https://api.github.com/repos/mapbox/carmen-cache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/carmen-cache/downloads","issues_url":"https://api.github.com/repos/mapbox/carmen-cache/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/carmen-cache/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/carmen-cache/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/carmen-cache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/carmen-cache/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/carmen-cache/releases{/id}","created_at":"2014-04-02T08:27:40Z","updated_at":"2015-02-26T21:35:51Z","pushed_at":"2015-03-10T03:43:10Z","git_url":"git://github.com/mapbox/carmen-cache.git","ssh_url":"git@github.com:mapbox/carmen-cache.git","clone_url":"https://github.com/mapbox/carmen-cache.git","svn_url":"https://github.com/mapbox/carmen-cache","homepage":null,"size":1482,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/carmen-cache/pulls/14"},"html":{"href":"https://github.com/mapbox/carmen-cache/pull/14"},"issue":{"href":"https://api.github.com/repos/mapbox/carmen-cache/issues/14"},"comments":{"href":"https://api.github.com/repos/mapbox/carmen-cache/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/carmen-cache/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/carmen-cache/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/carmen-cache/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/carmen-cache/statuses/c45eb9f17dd7b9f889135836af837c320ded55c3"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"yhahn","id":83384,"avatar_url":"https://avatars.githubusercontent.com/u/83384?v=3","gravatar_id":"","url":"https://api.github.com/users/yhahn","html_url":"https://github.com/yhahn","followers_url":"https://api.github.com/users/yhahn/followers","following_url":"https://api.github.com/users/yhahn/following{/other_user}","gists_url":"https://api.github.com/users/yhahn/gists{/gist_id}","starred_url":"https://api.github.com/users/yhahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhahn/subscriptions","organizations_url":"https://api.github.com/users/yhahn/orgs","repos_url":"https://api.github.com/users/yhahn/repos","events_url":"https://api.github.com/users/yhahn/events{/privacy}","received_events_url":"https://api.github.com/users/yhahn/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":3,"additions":59,"deletions":2,"changed_files":3}}