{"action":"created","issue":{"url":"https://api.github.com/repos/increments/qiita-elasticsearch/issues/10","labels_url":"https://api.github.com/repos/increments/qiita-elasticsearch/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/increments/qiita-elasticsearch/issues/10/comments","events_url":"https://api.github.com/repos/increments/qiita-elasticsearch/issues/10/events","html_url":"https://github.com/increments/qiita-elasticsearch/pull/10","id":91740284,"number":10,"title":"Combine phrase and best_fields queries for unquoted matchable token","user":{"login":"yuku-t","id":96157,"avatar_url":"https://avatars.githubusercontent.com/u/96157?v=3","gravatar_id":"","url":"https://api.github.com/users/yuku-t","html_url":"https://github.com/yuku-t","followers_url":"https://api.github.com/users/yuku-t/followers","following_url":"https://api.github.com/users/yuku-t/following{/other_user}","gists_url":"https://api.github.com/users/yuku-t/gists{/gist_id}","starred_url":"https://api.github.com/users/yuku-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuku-t/subscriptions","organizations_url":"https://api.github.com/users/yuku-t/orgs","repos_url":"https://api.github.com/users/yuku-t/repos","events_url":"https://api.github.com/users/yuku-t/events{/privacy}","received_events_url":"https://api.github.com/users/yuku-t/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-29T08:49:15Z","updated_at":"2015-06-29T11:19:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/increments/qiita-elasticsearch/pulls/10","html_url":"https://github.com/increments/qiita-elasticsearch/pull/10","diff_url":"https://github.com/increments/qiita-elasticsearch/pull/10.diff","patch_url":"https://github.com/increments/qiita-elasticsearch/pull/10.patch"},"body":"完全一致した文書がなかなか上位に来ないという問題に対処するために、クエリを連続して含む記事により高いスコアを付与するように変更しました。\r\n\r\nreview plz @r7kamura \r\n\r\n### 変更点\r\n\r\nこれまでは `\"` で囲まれていないクエリには \"best_fields\" matchクエリをだけを使っていましたが、\"phrase\" と \"best_fields\" matchクエリを合わせたクエリを使うようにしました。\r\n\r\n#### 動作例\r\n\r\nあるインデックスに\"電話番号\"というクエリを投げたとき、masterとboost-phrase-matchingブランチはそれぞれ同じ順番でドキュメントを返します:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/96157/8404054/f2792c9c-1e84-11e5-857a-a4ecf21dcc7e.png)\r\n\r\nしかし、Elasticsearchが返すスコアは全く異なります:\r\n\r\n```\r\n# master\r\n0.44672415\r\n0.3062868\r\n0.27920258\r\n0.1515718\r\n0.10450438\r\n\r\n# boost-phrase-matching\r\n0.7445402\r\n0.051047802\r\n0.046533763\r\n0.025261965\r\n0.017417395\r\n```\r\n\r\nboost-phrase-matchingでは連続した表現により大きなスコアが割り当てられるのでクエリに合致した記事がより高確率で高いスコアを獲得することが期待されます。"},"comment":{"url":"https://api.github.com/repos/increments/qiita-elasticsearch/issues/comments/116616732","html_url":"https://github.com/increments/qiita-elasticsearch/pull/10#issuecomment-116616732","issue_url":"https://api.github.com/repos/increments/qiita-elasticsearch/issues/10","id":116616732,"user":{"login":"yuku-t","id":96157,"avatar_url":"https://avatars.githubusercontent.com/u/96157?v=3","gravatar_id":"","url":"https://api.github.com/users/yuku-t","html_url":"https://github.com/yuku-t","followers_url":"https://api.github.com/users/yuku-t/followers","following_url":"https://api.github.com/users/yuku-t/following{/other_user}","gists_url":"https://api.github.com/users/yuku-t/gists{/gist_id}","starred_url":"https://api.github.com/users/yuku-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuku-t/subscriptions","organizations_url":"https://api.github.com/users/yuku-t/orgs","repos_url":"https://api.github.com/users/yuku-t/repos","events_url":"https://api.github.com/users/yuku-t/events{/privacy}","received_events_url":"https://api.github.com/users/yuku-t/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T11:19:41Z","updated_at":"2015-06-29T11:19:41Z","body":"@r7kamura \r\n\r\n- キーワード引数のデフォルト引数の省略は別に必須じゃないので使うのやめて、rvmも2.0.0に戻しました。\r\n- `::SpecHelper` を `Qiita::Elasticsearch::SpecHelper` に移動しました"}}