{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/203392964","pull_request_review_id":138271890,"id":203392964,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzM5Mjk2NA==","diff_hunk":"@@ -0,0 +1,280 @@\n+#include \"map/discovery/discovery_search.hpp\"\n+\n+#include \"search/intermediate_result.hpp\"\n+#include \"search/utils.hpp\"\n+\n+#include \"indexer/data_source.hpp\"\n+#include \"indexer/feature_algo.hpp\"\n+\n+#include \"platform/platform.hpp\"\n+\n+#include \"base/assert.hpp\"\n+\n+#include <algorithm>\n+#include <set>\n+#include <utility>\n+\n+namespace\n+{\n+search::Result MakeResultFromFeatureType(FeatureType const & ft)\n+{\n+  std::string name;\n+  ft.GetName(StringUtf8Multilang::GetLangIndex(languages::GetCurrentNorm()), name);\n+\n+  feature::TypesHolder holder(ft);\n+  holder.SortBySpec();\n+  CategoriesHolder const & categories = GetDefaultCategories();\n+  auto const readableType = categories.GetReadableFeatureType(\n+      holder.GetBestType(), categories.MapLocaleToInteger(languages::GetCurrentOrig()));\n+\n+  search::Result::Metadata metadata;\n+  search::ProcessMetadata(ft, metadata);\n+\n+  return {ft.GetID(), feature::GetCenter(ft), name, \"\", readableType, holder.GetBestType(), metadata};\n+}\n+\n+FeatureType MakeFeatureTypeWithCachedGuard(DataSource const & dataSource, MwmSet::MwmId & mwmId,\n+                                           std::unique_ptr<FeaturesLoaderGuard> & guard,\n+                                           FeatureID const & id)\n+{\n+  if (mwmId != id.m_mwmId)\n+  {\n+    guard = my::make_unique<FeaturesLoaderGuard>(dataSource, id.m_mwmId);\n+    mwmId = id.m_mwmId;\n+  }\n+\n+  FeatureType ft;\n+  if (!guard->GetFeatureByIndex(id.m_index, ft))\n+  {\n+    LOG(LERROR, (\"Feature can't be loaded:\", id));\n+    return {};\n+  }\n+\n+  return ft;\n+}\n+\n+class GreaterRating\n+{\n+public:\n+  bool operator()(FeatureType const & lhs, FeatureType const & rhs) const\n+  {\n+    double constexpr kPenaltyRating = -1.0;\n+    double lhsRating = kPenaltyRating;\n+    double rhsRating = kPenaltyRating;\n+\n+    if (!strings::to_double(lhs.GetMetadata().Get(feature::Metadata::EType::FMD_RATING), lhsRating))\n+      lhsRating = kPenaltyRating;\n+\n+    if (!strings::to_double(rhs.GetMetadata().Get(feature::Metadata::EType::FMD_RATING), rhsRating))\n+      rhsRating = kPenaltyRating;\n+\n+    return lhsRating > rhsRating;\n+  }\n+};\n+}  // namespace\n+namespace discovery\n+{\n+SearchBase::SearchBase(DataSource const & dataSource, DiscoverySearchParams const & params,\n+                       search::ProductInfo::Delegate const & productInfoDelegate)\n+  : m_dataSource(dataSource)\n+  , m_params(params)\n+  , m_productInfoDelegate(productInfoDelegate)\n+{\n+  CHECK(params.m_onResults, ());\n+  CHECK(!params.m_query.empty(), ());\n+  CHECK_GREATER(params.m_itemsCount, 0, ());\n+}\n+\n+void SearchBase::Search()\n+{\n+  MwmSet::MwmId currentMwmId;\n+  MwmSet::MwmHandle currentMwmHandle;","path":"map/discovery/discovery_search.cpp","position":91,"original_position":91,"commit_id":"c5e215b7524a12c3f1b4f985bf8449c2d4222621","original_commit_id":"c5e215b7524a12c3f1b4f985bf8449c2d4222621","user":{"login":"tatiana-yan","id":9213190,"node_id":"MDQ6VXNlcjkyMTMxOTA=","avatar_url":"https://avatars3.githubusercontent.com/u/9213190?v=4","gravatar_id":"","url":"https://api.github.com/users/tatiana-yan","html_url":"https://github.com/tatiana-yan","followers_url":"https://api.github.com/users/tatiana-yan/followers","following_url":"https://api.github.com/users/tatiana-yan/following{/other_user}","gists_url":"https://api.github.com/users/tatiana-yan/gists{/gist_id}","starred_url":"https://api.github.com/users/tatiana-yan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatiana-yan/subscriptions","organizations_url":"https://api.github.com/users/tatiana-yan/orgs","repos_url":"https://api.github.com/users/tatiana-yan/repos","events_url":"https://api.github.com/users/tatiana-yan/events{/privacy}","received_events_url":"https://api.github.com/users/tatiana-yan/received_events","type":"User","site_admin":false},"body":"не используется дальше","created_at":"2018-07-18T14:08:38Z","updated_at":"2018-07-18T14:08:39Z","html_url":"https://github.com/mapsme/omim/pull/9135#discussion_r203392964","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/9135","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/203392964"},"html":{"href":"https://github.com/mapsme/omim/pull/9135#discussion_r203392964"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9135"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/9135","id":202240005,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMjQwMDA1","html_url":"https://github.com/mapsme/omim/pull/9135","diff_url":"https://github.com/mapsme/omim/pull/9135.diff","patch_url":"https://github.com/mapsme/omim/pull/9135.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/9135","number":9135,"state":"open","locked":false,"title":"[DNM]Discovery new search","user":{"login":"milchakov","id":2606569,"node_id":"MDQ6VXNlcjI2MDY1Njk=","avatar_url":"https://avatars1.githubusercontent.com/u/2606569?v=4","gravatar_id":"","url":"https://api.github.com/users/milchakov","html_url":"https://github.com/milchakov","followers_url":"https://api.github.com/users/milchakov/followers","following_url":"https://api.github.com/users/milchakov/following{/other_user}","gists_url":"https://api.github.com/users/milchakov/gists{/gist_id}","starred_url":"https://api.github.com/users/milchakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milchakov/subscriptions","organizations_url":"https://api.github.com/users/milchakov/orgs","repos_url":"https://api.github.com/users/milchakov/repos","events_url":"https://api.github.com/users/milchakov/events{/privacy}","received_events_url":"https://api.github.com/users/milchakov/received_events","type":"User","site_admin":false},"body":"Пока-что крешится при вычитке имен фичей","created_at":"2018-07-18T12:42:31Z","updated_at":"2018-07-18T14:08:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"73d6518ac4ee90346f02a8226fa59d7744c5956e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/9135/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/9135/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/9135/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/c5e215b7524a12c3f1b4f985bf8449c2d4222621","head":{"label":"milchakov:discovery_new_search","ref":"discovery_new_search","sha":"c5e215b7524a12c3f1b4f985bf8449c2d4222621","user":{"login":"milchakov","id":2606569,"node_id":"MDQ6VXNlcjI2MDY1Njk=","avatar_url":"https://avatars1.githubusercontent.com/u/2606569?v=4","gravatar_id":"","url":"https://api.github.com/users/milchakov","html_url":"https://github.com/milchakov","followers_url":"https://api.github.com/users/milchakov/followers","following_url":"https://api.github.com/users/milchakov/following{/other_user}","gists_url":"https://api.github.com/users/milchakov/gists{/gist_id}","starred_url":"https://api.github.com/users/milchakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milchakov/subscriptions","organizations_url":"https://api.github.com/users/milchakov/orgs","repos_url":"https://api.github.com/users/milchakov/repos","events_url":"https://api.github.com/users/milchakov/events{/privacy}","received_events_url":"https://api.github.com/users/milchakov/received_events","type":"User","site_admin":false},"repo":{"id":61498503,"node_id":"MDEwOlJlcG9zaXRvcnk2MTQ5ODUwMw==","name":"omim","full_name":"milchakov/omim","owner":{"login":"milchakov","id":2606569,"node_id":"MDQ6VXNlcjI2MDY1Njk=","avatar_url":"https://avatars1.githubusercontent.com/u/2606569?v=4","gravatar_id":"","url":"https://api.github.com/users/milchakov","html_url":"https://github.com/milchakov","followers_url":"https://api.github.com/users/milchakov/followers","following_url":"https://api.github.com/users/milchakov/following{/other_user}","gists_url":"https://api.github.com/users/milchakov/gists{/gist_id}","starred_url":"https://api.github.com/users/milchakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milchakov/subscriptions","organizations_url":"https://api.github.com/users/milchakov/orgs","repos_url":"https://api.github.com/users/milchakov/repos","events_url":"https://api.github.com/users/milchakov/events{/privacy}","received_events_url":"https://api.github.com/users/milchakov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/milchakov/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/milchakov/omim","forks_url":"https://api.github.com/repos/milchakov/omim/forks","keys_url":"https://api.github.com/repos/milchakov/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/milchakov/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/milchakov/omim/teams","hooks_url":"https://api.github.com/repos/milchakov/omim/hooks","issue_events_url":"https://api.github.com/repos/milchakov/omim/issues/events{/number}","events_url":"https://api.github.com/repos/milchakov/omim/events","assignees_url":"https://api.github.com/repos/milchakov/omim/assignees{/user}","branches_url":"https://api.github.com/repos/milchakov/omim/branches{/branch}","tags_url":"https://api.github.com/repos/milchakov/omim/tags","blobs_url":"https://api.github.com/repos/milchakov/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/milchakov/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/milchakov/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/milchakov/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/milchakov/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/milchakov/omim/languages","stargazers_url":"https://api.github.com/repos/milchakov/omim/stargazers","contributors_url":"https://api.github.com/repos/milchakov/omim/contributors","subscribers_url":"https://api.github.com/repos/milchakov/omim/subscribers","subscription_url":"https://api.github.com/repos/milchakov/omim/subscription","commits_url":"https://api.github.com/repos/milchakov/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/milchakov/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/milchakov/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/milchakov/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/milchakov/omim/contents/{+path}","compare_url":"https://api.github.com/repos/milchakov/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/milchakov/omim/merges","archive_url":"https://api.github.com/repos/milchakov/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/milchakov/omim/downloads","issues_url":"https://api.github.com/repos/milchakov/omim/issues{/number}","pulls_url":"https://api.github.com/repos/milchakov/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/milchakov/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/milchakov/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/milchakov/omim/labels{/name}","releases_url":"https://api.github.com/repos/milchakov/omim/releases{/id}","deployments_url":"https://api.github.com/repos/milchakov/omim/deployments","created_at":"2016-06-19T20:16:05Z","updated_at":"2018-07-05T13:22:18Z","pushed_at":"2018-07-18T12:48:24Z","git_url":"git://github.com/milchakov/omim.git","ssh_url":"git@github.com:milchakov/omim.git","clone_url":"https://github.com/milchakov/omim.git","svn_url":"https://github.com/milchakov/omim","homepage":null,"size":3980378,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:release-83","ref":"release-83","sha":"515bb5b6966a102faa2236d41dbebb5ed9fc99f5","user":{"login":"mapsme","id":14185141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTg1MTQx","avatar_url":"https://avatars1.githubusercontent.com/u/14185141?v=4","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"node_id":"MDEwOlJlcG9zaXRvcnk0Mjc5ODAzMw==","name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTg1MTQx","avatar_url":"https://avatars1.githubusercontent.com/u/14185141?v=4","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2018-07-18T12:11:13Z","pushed_at":"2018-07-18T14:02:17Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":"","size":4000101,"stargazers_count":2715,"watchers_count":2715,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":592,"mirror_url":null,"archived":false,"open_issues_count":714,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":592,"open_issues":714,"watchers":2715,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9135"},"html":{"href":"https://github.com/mapsme/omim/pull/9135"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/9135"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/9135/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9135/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9135/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/c5e215b7524a12c3f1b4f985bf8449c2d4222621"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tatiana-yan"}}