{"id":85397,"date":"2025-03-28T18:35:47","date_gmt":"2025-03-28T11:35:47","guid":{"rendered":"https:\/\/itviecblog.uptech.vn\/?p=85397"},"modified":"2025-06-17T09:08:16","modified_gmt":"2025-06-17T02:08:16","slug":"elasticsearch-query-la-gi","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/","title":{"rendered":"Elasticsearch Query: Kh\u00e1m ph\u00e1 b\u00ed k\u00edp t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#Elasticsearch_Query_la_gi\" >Elasticsearch Query l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#Tai_sao_Query_lai_quan_trong_trong_Elasticsearch\" >T\u1ea1i sao Query l\u1ea1i quan tr\u1ecdng trong Elasticsearch?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#Cac_loai_Elasticsearch_Query_pho_bien\" >C\u00e1c lo\u1ea1i Elasticsearch Query ph\u1ed5 bi\u1ebfn<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#Huong_dan_toi_uu_hoa_hieu_suat_truy_van_bang_Elasticsearch_Query\" >H\u01b0\u1edbng d\u1eabn t\u1ed1i \u01b0u h\u00f3a hi\u1ec7u su\u1ea5t truy v\u1ea5n b\u1eb1ng Elasticsearch Query<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#Cau_hoi_thuong_gap\" >C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#Tong_ket\" >T\u1ed5ng k\u1ebft<\/a><\/li><\/ul><\/nav><\/div>\n<p><em><strong>B\u1ea1n c\u1ea7n m\u1ed9t gi\u1ea3i ph\u00e1p t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c, m\u1ea1nh m\u1ebd v\u00e0 linh ho\u1ea1t? Elasticsearch Query s\u1ebd gi\u00fap b\u1ea1n truy xu\u1ea5t th\u00f4ng tin nhanh ch\u00f3ng t\u1eeb kh\u1ed1i l\u01b0\u1ee3ng d\u1eef li\u1ec7u kh\u1ed5ng l\u1ed3, mang \u0111\u1ebfn kh\u1ea3 n\u0103ng ph\u00e2n t\u00edch d\u1eef li\u1ec7u chuy\u00ean s\u00e2u. B\u00e0i vi\u1ebft n\u00e0y s\u1ebd gi\u00fap b\u1ea1n l\u00e0m quen v\u1edbi c\u00e1c lo\u1ea1i Elasticsearch Query t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao, gi\u00fap b\u1ea1n l\u00e0m ch\u1ee7 c\u00f4ng c\u1ee5 n\u00e0y m\u1ed9t c\u00e1ch nhanh nh\u1ea5t.<\/strong><\/em><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ecdc b\u00e0i vi\u1ebft \u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Elasticsearch Query l\u00e0 g\u00ec?<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1ea1i sao Query l\u1ea1i quan tr\u1ecdng trong Elasticsearch?<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1c lo\u1ea1i Elasticsearch Query c\u01a1 b\u1ea3n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1c lo\u1ea1i Elasticsearch Query n\u00e2ng cao<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1ch t\u1ed1i \u01b0u h\u00f3a hi\u1ec7u su\u1ea5t truy v\u1ea5n b\u1eb1ng Elasticsearch Query<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Elasticsearch_Query_la_gi\"><\/span><b>Elasticsearch Query l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Elasticsearch Query \u0111\u01b0\u1ee3c \u0111\u01b0a v\u00e0o c\u00f4ng c\u1ee5 t\u00ecm ki\u1ebfm \u0111\u1ec3 t\u00ecm c\u00e1c t\u00e0i li\u1ec7u c\u1ee5 th\u1ec3 t\u1eeb m\u1ed9t ho\u1eb7c nhi\u1ec1u ch\u1ec9 m\u1ee5c. Elasticsearch Query \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf nh\u01b0 m\u1ed9t c\u00f4ng c\u1ee5 t\u00ecm ki\u1ebfm v\u00e0 ph\u00e2n t\u00edch RESTful ph\u00e2n t\u00e1n, gi\u00fap Elasticsearch h\u1eefu \u00edch cho vi\u1ec7c t\u00ecm ki\u1ebfm to\u00e0n v\u0103n, ph\u00e2n t\u00edch th\u1eddi gian th\u1ef1c v\u00e0 tr\u1ef1c quan h\u00f3a d\u1eef li\u1ec7u. Elasticsearch Query hi\u1ec7u qu\u1ea3 trong vi\u1ec7c t\u00ecm ki\u1ebfm kh\u1ed1i l\u01b0\u1ee3ng d\u1eef li\u1ec7u l\u1edbn.<\/span><\/p>\n<blockquote><p><em>\u0110\u1ecdc th\u00eam: <a href=\"\/blog\/elasticsearch-la-gi\/\" target=\"_blank\" rel=\"noopener\"><strong>T\u1eeb A \u0111\u1ebfn Z v\u1ec1 Elasticsearch: \u201cV\u0169 kh\u00ed\u201d b\u00ed m\u1eadt cho c\u00e1c \u1ee9ng d\u1ee5ng d\u1eef li\u1ec7u l\u1edbn<\/strong><\/a><\/em><\/p><\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"Tai_sao_Query_lai_quan_trong_trong_Elasticsearch\"><\/span><b>T\u1ea1i sao Query l\u1ea1i quan tr\u1ecdng trong Elasticsearch?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Query \u0111\u00f3ng vai tr\u00f2 then ch\u1ed1t trong Elasticsearch v\u00ec n\u00f3 l\u00e0 ph\u01b0\u01a1ng ti\u1ec7n ch\u00ednh \u0111\u1ec3 b\u1ea1n t\u01b0\u01a1ng t\u00e1c v\u00e0 khai th\u00e1c d\u1eef li\u1ec7u trong h\u1ec7 th\u1ed1ng. C\u1ee5 th\u1ec3 c\u00e1c vai tr\u00f2 c\u1ee7a Query l\u00e0:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Truy xu\u1ea5t d\u1eef li\u1ec7u ch\u00ednh x\u00e1c v\u00e0 nhanh ch\u00f3ng:<\/b><span style=\"font-weight: 400;\"> Query cho ph\u00e9p t\u00ecm ki\u1ebfm v\u00e0 truy xu\u1ea5t th\u00f4ng tin c\u1ee5 th\u1ec3 t\u1eeb kho d\u1eef li\u1ec7u kh\u1ed5ng l\u1ed3 \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong Elasticsearch. T\u1eeb \u0111\u00f3 b\u1ea1n \u0111\u1ecbnh ngh\u0129a c\u00e1c ti\u00eau ch\u00ed t\u00ecm ki\u1ebfm chi ti\u1ebft \u0111\u1ec3 l\u1ecdc v\u00e0 thu h\u1eb9p k\u1ebft qu\u1ea3, \u0111\u1ea3m b\u1ea3o b\u1ea1n ch\u1ec9 nh\u1eadn \u0111\u01b0\u1ee3c nh\u1eefng th\u00f4ng tin li\u00ean quan nh\u1ea5t.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Ph\u00e2n t\u00edch d\u1eef li\u1ec7u chuy\u00ean s\u00e2u: <\/b><span style=\"font-weight: 400;\">Ngo\u00e0i vi\u1ec7c t\u00ecm ki\u1ebfm, Query c\u00f2n h\u1ed7 tr\u1ee3 c\u00e1c ch\u1ee9c n\u0103ng ph\u00e2n t\u00edch d\u1eef li\u1ec7u m\u1ea1nh m\u1ebd nh\u01b0: t\u1ed5ng h\u1ee3p d\u1eef li\u1ec7u, t\u00ednh to\u00e1n th\u1ed1ng k\u00ea v\u00e0 kh\u00e1m ph\u00e1 c\u00e1c m\u1eabu d\u1eef li\u1ec7u \u1ea9n s\u00e2u.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Linh ho\u1ea1t v\u00e0 m\u1ea1nh m\u1ebd:<\/b><span style=\"font-weight: 400;\"> Elasticsearch cung c\u1ea5p Query DSL &#8211; m\u1ed9t ng\u00f4n ng\u1eef truy v\u1ea5n linh ho\u1ea1t v\u00e0 m\u1ea1nh m\u1ebd, cho ph\u00e9p b\u1ea1n x\u00e2y d\u1ef1ng c\u00e1c truy v\u1ea5n ph\u1ee9c t\u1ea1p v\u00e0 tinh vi. N\u00f3 h\u1ed7 tr\u1ee3 nhi\u1ec1u lo\u1ea1i truy v\u1ea5n kh\u00e1c nhau, t\u1eeb t\u00ecm ki\u1ebfm v\u0103n b\u1ea3n \u0111\u01a1n gi\u1ea3n \u0111\u1ebfn truy v\u1ea5n \u0111\u1ecba l\u00fd kh\u00f4ng gian v\u00e0 truy v\u1ea5n theo th\u1eddi gian.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u1ed1i \u01b0u h\u00f3a hi\u1ec7u su\u1ea5t t\u00ecm ki\u1ebfm v\u00e0 ph\u00e2n t\u00edch d\u1eef li\u1ec7u: <\/b><span style=\"font-weight: 400;\">Elasticsearch cung c\u1ea5p c\u00e1c c\u00f4ng c\u1ee5 v\u00e0 k\u1ef9 thu\u1eadt \u0111\u1ec3 b\u1ea1n tinh ch\u1ec9nh truy v\u1ea5n v\u00e0 \u0111\u1ea3m b\u1ea3o th\u1eddi gian ph\u1ea3n h\u1ed3i nhanh ch\u00f3ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>\u1ee8ng d\u1ee5ng \u0111a d\u1ea1ng: <\/b><span style=\"font-weight: 400;\">Query l\u00e0 n\u1ec1n t\u1ea3ng cho nhi\u1ec1u \u1ee9ng d\u1ee5ng kh\u00e1c nhau s\u1eed d\u1ee5ng Elasticsearch, bao g\u1ed3m t\u00ecm ki\u1ebfm trang web, ph\u00e2n t\u00edch nh\u1eadt k\u00fd, gi\u00e1m s\u00e1t \u1ee9ng d\u1ee5ng v\u00e0 ph\u00e2n t\u00edch d\u1eef li\u1ec7u kinh doanh.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Cac_loai_Elasticsearch_Query_pho_bien\"><\/span><b>C\u00e1c lo\u1ea1i Elasticsearch Query ph\u1ed5 bi\u1ebfn<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Basic Match query<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Truy v\u1ea5n n\u00e0y cho ph\u00e9p ch\u00fang ta t\u00ecm ki\u1ebfm m\u1ed9t t\u1eeb trong m\u1ed9t tr\u01b0\u1eddng c\u1ee5 th\u1ec3 ho\u1eb7c trong t\u1ea5t c\u1ea3 c\u00e1c tr\u01b0\u1eddng.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, n\u1ebfu ch\u00fang ta mu\u1ed1n t\u00ecm ki\u1ebfm &#8216;Web Technology&#8217; trong tr\u01b0\u1eddng name, ch\u00fang ta c\u1ea7n th\u1ef1c hi\u1ec7n:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {\"match\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"name\": \"Web Technology\"}},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_source\": [\"name\", \"brief_info\"]<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 2.9127758,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"1\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 2.9127758,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"You can improve yourself in web technology by using django, Elasticsearch, and CI\/CD tools. You can work remotely in San Francisco by having too much fun!\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Web Technology Company\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1eeb &#8216;Web&#8217; v\u00e0 &#8216;Technology&#8217; \u0111\u01b0\u1ee3c ph\u00e2n t\u00edch v\u00e0 t\u00ecm ki\u1ebfm trong tr\u01b0\u1eddng name. K\u1ebft qu\u1ea3 tr\u1ea3 v\u1ec1 t\u00e0i li\u1ec7u kh\u1edbp v\u1edbi c\u1ee5m t\u1eeb n\u00e0y.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Tr\u01b0\u1eddng _source \u0111\u01b0\u1ee3c d\u00f9ng \u0111\u1ec3 gi\u1edbi h\u1ea1n c\u00e1c tr\u01b0\u1eddng hi\u1ec3n th\u1ecb trong k\u1ebft qu\u1ea3.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Match Query ph\u00f9 h\u1ee3p \u0111\u1ec3 t\u00ecm ki\u1ebfm v\u0103n b\u1ea3n t\u1ef1 nhi\u00ean, kh\u00f4ng y\u00eau c\u1ea7u kh\u1edbp ch\u00ednh x\u00e1c t\u1eebng t\u1eeb, nh\u1edd c\u01a1 ch\u1ebf ph\u00e2n t\u00edch (analysis) c\u1ee7a Elasticsearch. N\u1ebfu c\u1ea7n t\u00ecm ki\u1ebfm ch\u00ednh x\u00e1c, n\u00ean d\u00f9ng match_phrase thay v\u00ec match.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">N\u1ebfu b\u1ea1n mu\u1ed1n t\u00ecm ki\u1ebfm m\u1ed9t t\u1eeb trong nhi\u1ec1u tr\u01b0\u1eddng, h\u00e3y s\u1eed d\u1ee5ng truy v\u1ea5n &#8216;multi_match&#8217;.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, khi mu\u1ed1n t\u00ecm ki\u1ebfm c\u00e1c c\u00f4ng ty c\u00f3 benefits &#8216;sport discount&#8217; v\u00e0 \u1edf city l\u00e0 &#8216;San Francisco&#8217;, ch\u00fang ta th\u1ef1c hi\u1ec7n l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"multi_match\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"query\": \"San Francisco sport\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"fields\": [\"city\", \"benefits\"]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_source\": [\"city\", \"benefits\"]<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Truy v\u1ea5n n\u00e0y s\u1ebd t\u00ecm ki\u1ebfm San Francisco v\u00e0 c\u00e1c t\u1eeb &#8216;sport&#8217; trong c\u00e1c tr\u01b0\u1eddng &#8216;city&#8217; v\u00e0 &#8216;benefits&#8217;. B\u1ea5t c\u1ee9 khi n\u00e0o c\u00f3 s\u1ef1 tr\u00f9ng kh\u1edbp, t\u00e0i li\u1ec7u \u0111\u00f3 s\u1ebd \u0111\u01b0\u1ee3c th\u00eam v\u00e0o k\u1ebft qu\u1ea3. Do \u0111\u00f3, output s\u1ebd l\u00e0:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 2.1784625,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"1\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 2.1784625,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"benefits\" : \"snacks, learning budget, sport discount\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : \"San Francisco\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">N\u1ebfu kh\u00f4ng ch\u1ec9 \u0111\u1ecbnh c\u00e1c tr\u01b0\u1eddng trong truy v\u1ea5n multi_match, t\u1eeb mong mu\u1ed1n s\u1ebd \u0111\u01b0\u1ee3c t\u00ecm ki\u1ebfm trong t\u1ea5t c\u1ea3 c\u00e1c tr\u01b0\u1eddng. Khi b\u1eaft \u0111\u1ea7u l\u1eadp ch\u1ec9 m\u1ee5c, Elasticsearch gi\u1eef t\u1ea5t c\u1ea3 c\u00e1c tr\u01b0\u1eddng trong tr\u01b0\u1eddng <\/span><b>_all<\/b><span style=\"font-weight: 400;\">. Tr\u01b0\u1eddng <\/span><b>_all<\/b><span style=\"font-weight: 400;\"> \u0111\u01b0\u1ee3c t\u1ea1o b\u1eb1ng c\u00e1ch n\u1ed1i t\u1ea5t c\u1ea3 c\u00e1c source tr\u01b0\u1eddng c\u1ee7a t\u00e0i li\u1ec7u. V\u00e0 Elasticsearch c\u00f3 th\u1ec3 t\u00ecm ki\u1ebfm t\u1eeb mong mu\u1ed1n b\u1eb1ng c\u00e1ch xem tr\u01b0\u1eddng <\/span><b>_all<\/b><span style=\"font-weight: 400;\"> n\u00e0y.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: Trong c\u00e1c phi\u00ean b\u1ea3n Elasticsearch tr\u01b0\u1edbc 7.x, \u0111i\u1ec1u n\u00e0y d\u1ef1a tr\u00ean tr\u01b0\u1eddng _all (k\u1ebft h\u1ee3p t\u1ea5t c\u1ea3 c\u00e1c tr\u01b0\u1eddng ngu\u1ed3n). Tuy nhi\u00ean, t\u1eeb phi\u00ean b\u1ea3n 7.x tr\u1edf \u0111i, _all \u0111\u00e3 b\u1ecb lo\u1ea1i b\u1ecf. Thay v\u00e0o \u0111\u00f3, b\u1ea1n c\u1ea7n ch\u1ec9 \u0111\u1ecbnh r\u00f5 c\u00e1c tr\u01b0\u1eddng ho\u1eb7c d\u00f9ng copy_to \u0111\u1ec3 t\u1ea1o tr\u01b0\u1eddng t\u1ed5ng h\u1ee3p ri\u00eang.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, h\u00e3y t\u00ecm ki\u1ebfm &#8216;web technology&#8217; trong t\u1ea5t c\u1ea3 c\u00e1c tr\u01b0\u1eddng b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng lo\u1ea1i truy v\u1ea5n multi_match.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"multi_match\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"query\": \"web technology\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Output s\u1ebd tr\u1ea3 v\u1ec1 c\u00e1c t\u00e0i li\u1ec7u c\u00f3 t\u1eeb &#8216;web&#8217; ho\u1eb7c &#8216;technology&#8217; trong b\u1ea5t k\u1ef3 tr\u01b0\u1eddng n\u00e0o:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 2,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 2.9127758,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"1\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 2.9127758,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Web Technology Company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"found_year\" : \"2012-12-28\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"avg_salary\" : \"5000$\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"benefits\" : \"snacks, learning budget, sport discount\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"num_emp\" : 2000,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : \"San Francisco\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"country\" : \"USA\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"You can improve yourself in web technology by using django, Elasticsearch, and CI\/CD tools. You can work remotely in San Francisco by having too much fun!\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"3\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.4868822,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Machine Learning Company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"found_year\" : \"2011-02-10\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"avg_salary\" : \"9000$\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"benefits\" : \"rented-house, snacks, learning budget, rented car\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"num_emp\" : 500,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : \"Ankara\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"country\" : \"Turkey\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"Do you want to imporove yourself in machine learning and web technology? So this is right place to work. Come and enjoy your workdays. You can work remotely and enjoy the view of the capital city, Ankara!\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<h3><b>Bool<\/b> <b>query<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Truy v\u1ea5n Bool \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 vi\u1ebft truy v\u1ea5n v\u1edbi to\u00e1n t\u1eed AND\/OR\/NOT th\u00f4ng qua must (AND), should (OR), v\u00e0 must_not (NOT).\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, n\u1ebfu mu\u1ed1n t\u00ecm ki\u1ebfm c\u00e1c c\u00f4ng ty c\u00f3 benefits\u00a0 l\u00e0 &#8216;sports&#8217; HO\u1eb6C &#8216;rented-house&#8217; v\u00e0 KH\u00d4NG \u1edf c\u00e1c city &#8216;Ankara&#8217; V\u00c0 &#8216;Amsterdam&#8217;, b\u1ea1n th\u1ef1c hi\u1ec7n truy v\u1ea5n sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search <\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"bool\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"must\": [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"bool\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"should\": [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"match\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"benefits\": \"sport\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"match\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"benefits\": \"rented house\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0],<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"must_not\": [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"bool\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"should\": [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"match\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\": \"Ankara\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"match\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\": \"Amsterdam\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Output:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 2,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 1.6243635,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"2\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.6243635,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Defense Industry Company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"found_year\" : \"2001-10-10\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"avg_salary\" : \"4000$\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"benefits\" : \"rented-house, snacks, learning budget\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"num_emp\" : 100,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : \"Munich\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"country\" : \"Germany\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"In our company we are working for defense industry. We are using c++. Codes are protected and you can only work in the office!\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"1\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.2860802,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Web Technology Company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"found_year\" : \"2012-12-28\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"avg_salary\" : \"5000$\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"benefits\" : \"snacks, learning budget, sport discount\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"num_emp\" : 2000,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : \"San Francisco\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"country\" : \"USA\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"You can improve yourself in web technology by using django, Elasticsearch, and CI\/CD tools. You can work remotely in San Francisco by having too much fun!\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<h3><b>Fuzzy query<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Khi t\u00ecm ki\u1ebfm b\u1eb1ng truy v\u1ea5n match v\u00e0 multi_match, b\u1ea1n c\u00f3 th\u1ec3 b\u1eadt t\u00ednh n\u0103ng fuzzy matching cho c\u00e1c c\u1ee5m t\u1eeb vi\u1ebft sai ch\u00ednh t\u1ea3.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, khi nh\u1eadp &#8216;developmentmnt&#8217; thay v\u00ec &#8216;development&#8217; b\u1eb1ng fuzzy query, b\u1ea1n v\u1eabn c\u00f3 th\u1ec3 t\u00ecm th\u1ea5y k\u1ebft qu\u1ea3. Trong truy v\u1ea5n t\u00ecm ki\u1ebfm, ch\u00fang ta c\u1ea7n ch\u1ec9 \u0111\u1ecbnh gi\u00e1 tr\u1ecb \u0111\u1ed9 sai l\u1ec7ch, ngh\u0129a l\u00e0 b\u1ea1n cho ph\u00e9p bao nhi\u00eau k\u00fd t\u1ef1 l\u1ed7i \u0111\u00e1nh m\u00e1y:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">N\u1ebfu vi\u1ebft 1, ngh\u0129a l\u00e0 ch\u1ec9 cho ph\u00e9p 1 k\u00fd t\u1ef1 kh\u00f4ng kh\u1edbp<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">N\u1ebfu nh\u1eadp 2, ngh\u0129a l\u00e0 cho ph\u00e9p 2 k\u00fd t\u1ef1 kh\u00f4ng kh\u1edbp.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">N\u1ebfu ch\u1ecdn AUTO, ngh\u0129a l\u00e0 t\u1ef1 \u0111\u1ed9ng \u0111i\u1ec1u ch\u1ec9nh d\u1ef1a tr\u00ean \u0111\u1ed9 d\u00e0i t\u1eeb (th\u01b0\u1eddng l\u00e0 0 cho t\u1eeb &lt; 3 k\u00fd t\u1ef1, 1 cho t\u1eeb 3-5 k\u00fd t\u1ef1, 2 cho t\u1eeb d\u00e0i h\u01a1n).<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 t\u00ecm ki\u1ebfm b\u1eb1ng fuzzy query:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"multi_match\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"query\" : \"developmnt\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"fields\": [\"name\", \"brief_info\"],<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"fuzziness\": \"AUTO\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"_source\": [\"brief_info\", \"name\"]<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Output:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 6,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 1.3056316,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"4\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.3056316,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"Are you interested in embedded system development? If you know or desire to learn c++, and improve yourself in this area apply now!\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Embedded System Development Company\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: Fuzzy Query c\u00f3 th\u1ec3 l\u00e0m t\u0103ng th\u1eddi gian x\u1eed l\u00fd v\u00e0 ti\u00eau t\u1ed1n t\u00e0i nguy\u00ean, n\u00ean ch\u1ec9 d\u00f9ng khi c\u1ea7n thi\u1ebft.<\/span><\/p>\n<h3><b>Wildcard query v\u00e0 Regexp query<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Truy v\u1ea5n Wildcard cho ph\u00e9p b\u1ea1n t\u00ecm ki\u1ebfm m\u1ed9t m\u1eabu c\u1ee5m t\u1eeb ph\u00f9 h\u1ee3p thay v\u00ec t\u00ecm ki\u1ebfm c\u1ee5m t\u1eeb \u0111\u1ea7y \u0111\u1ee7. Trong truy v\u1ea5n Wildcard ? kh\u1edbp v\u1edbi b\u1ea5t k\u1ef3 k\u00fd t\u1ef1 n\u00e0o, * kh\u1edbp v\u1edbi kh\u00f4ng ho\u1eb7c nhi\u1ec1u k\u00fd t\u1ef1.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, n\u1ebfu mu\u1ed1n t\u00ecm ki\u1ebfm developmentm* trong tr\u01b0\u1eddng brief_info, ch\u00fang ta c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n truy v\u1ea5n sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET\u00a0 \/companies\/company\/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"wildcard\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\": \"developm*\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"_source\": [\"name\", \"brief_info\"],<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"highlight\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"fields\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\": {}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<blockquote><p><i><span style=\"font-weight: 400;\">L\u01b0u \u00fd: Wildcard ho\u1ea1t \u0111\u1ed9ng t\u1ed1t tr\u00ean tr\u01b0\u1eddng keyword, nh\u01b0ng v\u1edbi tr\u01b0\u1eddng text, c\u1ea7n ch\u00fa \u00fd \u0111\u1ebfn c\u00e1ch ph\u00e2n t\u00edch (analysis) v\u00ec * v\u00e0 ? kh\u00f4ng \u00e1p d\u1ee5ng tr\u00ean t\u1eeb \u0111\u00e3 \u0111\u01b0\u1ee3c tokenized.<\/span><\/i><\/p><\/blockquote>\n<p><span style=\"font-weight: 400;\">Truy v\u1ea5n n\u00e0y s\u1ebd kh\u1edbp v\u1edbi b\u1ea5t k\u1ef3 t\u00e0i li\u1ec7u n\u00e0o c\u00f3 &#8216;developmentm*&#8217; trong tr\u01b0\u1eddng brief_info. V\u00ec t\u1eeb &#8216;development&#8217; ph\u00f9 h\u1ee3p v\u1edbi c\u1ee5m t\u1eeb n\u00ean ch\u00fang ta s\u1ebd th\u1ea5y k\u1ebft qu\u1ea3 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 4,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"4\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"Are you interested in embedded system development? If you know or desire to learn c++, and improve yourself in this area apply now!\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Embedded System Development Company\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"highlight\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Are you interested in embedded system &lt;em&gt;development&lt;\/em&gt;?\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ed1ng nh\u01b0 truy v\u1ea5n Wildcard, truy v\u1ea5n Regexp c\u0169ng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 t\u00ecm ki\u1ebfm m\u1ed9t m\u1eabu ph\u1ee9c t\u1ea1p h\u01a1n truy v\u1ea5n Wildcard. V\u00ed d\u1ee5, khi mu\u1ed1n t\u00ecm ki\u1ebfm c\u00e1c c\u00f4ng ty \u1edf c\u00e1c th\u00e0nh ph\u1ed1 k\u1ebft th\u00fac b\u1eb1ng &#8216;m&#8217;, ch\u00fang ta th\u1ef1c hi\u1ec7n :<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"regexp\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : \"[a-z]*m\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"_source\": [\"name\", \"city\"],<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"highlight\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"fields\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : {}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Output:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 2,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"5\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : \"Amsterdam\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Internet of Things Company\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"highlight\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"city\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"&lt;em&gt;Amsterdam&lt;\/em&gt;\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: Regexp m\u1ea1nh m\u1ebd nh\u01b0ng c\u00f3 th\u1ec3 ch\u1eadm v\u1edbi bi\u1ec3u th\u1ee9c ph\u1ee9c t\u1ea1p ho\u1eb7c d\u1eef li\u1ec7u l\u1edbn.<\/span><\/p>\n<h3><b>Match Phrase query<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Truy v\u1ea5n Match Phrase y\u00eau c\u1ea7u c\u1ee5m t\u1eeb t\u00ecm ki\u1ebfm ph\u1ea3i xu\u1ea5t hi\u1ec7n theo c\u00f9ng th\u1ee9 t\u1ef1 trong tr\u01b0\u1eddng t\u00ecm ki\u1ebfm, g\u1ea7n nhau. V\u00ed d\u1ee5, n\u1ebfu ch\u00fang ta t\u00ecm ki\u1ebfm &#8216;web development&#8217; trong tr\u01b0\u1eddng brief_info , ch\u00fang ta n\u00f3i r\u1eb1ng &#8216;web technology&#8217; ph\u1ea3i xu\u1ea5t hi\u1ec7n ch\u00ednh x\u00e1c theo c\u00f9ng th\u1ee9 t\u1ef1 trong tr\u01b0\u1eddng n\u00e0y. H\u00e3y tr\u00ecnh b\u00e0y b\u1eb1ng m\u1ed9t truy v\u1ea5n Match Phrase v\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search <\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"match_phrase\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\":\"web technology\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"_source\": [\"name\", \"brief_info\"],<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"highlight\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"fields\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\": {}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Output:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 10,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 2,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 1.7182437,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"1\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.7182437,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"You can improve yourself in web technology by using django, Elasticsearch, and CI\/CD tools. You can work remotely in San Francisco by having too much fun!\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Web Technology Company\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"highlight\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"You can improve yourself in &lt;em&gt;web&lt;\/em&gt; &lt;em&gt;technology&lt;\/em&gt; by using django, Elasticsearch, and CI\/CD tools.\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"3\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.4868822,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : \"Do you want to imporove yourself in machine learning and web technology? So this is right place to work. Come and enjoy your workdays. You can work remotely and enjoy the view of the capital city, Ankara!\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Machine Learning Company\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"highlight\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"brief_info\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Do you want to imporove yourself in machine learning and &lt;em&gt;web&lt;\/em&gt; &lt;em&gt;technology&lt;\/em&gt;?\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">N\u1ebfu nh\u1eadp c\u1ee5m t\u1eeb kh\u00f4ng t\u1ed3n t\u1ea1i nh\u01b0 &#8216;web tech&#8217;, k\u1ebft qu\u1ea3 s\u1ebd tr\u1ed1ng nh\u01b0 b\u00ean d\u01b0\u1edbi:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : null,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [ ]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<h3><b>Term v\u00e0 Terms query<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Truy v\u1ea5n Term and Terms \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 t\u00ecm ki\u1ebfm k\u1ebft qu\u1ea3 kh\u1edbp ch\u00ednh x\u00e1c trong tr\u01b0\u1eddng. N\u1ebfu b\u1ea1n mu\u1ed1n t\u00ecm ki\u1ebfm c\u00e1c c\u00f4ng ty c\u00f3 s\u1ed1 nh\u00e2n vi\u00ean ch\u00ednh x\u00e1c l\u00e0 500, h\u00e3y s\u1eed d\u1ee5ng truy v\u1ea5n term nh\u01b0 b\u00ean d\u01b0\u1edbi:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"term\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"num_emp\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"value\": \"500\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"_source\": [\"name\", \"num_emp\"]<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Output:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"3\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Machine Learning Company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"num_emp\" : 500<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: V\u1edbi tr\u01b0\u1eddng s\u1ed1 ho\u1eb7c keyword, term ho\u1ea1t \u0111\u1ed9ng t\u1ed1t. V\u1edbi tr\u01b0\u1eddng text, c\u1ea7n d\u00f9ng match thay v\u00ec term do c\u01a1 ch\u1ebf ph\u00e2n t\u00edch.<\/span><\/p>\n<h3><b>Range query<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Truy v\u1ea5n Range cho ph\u00e9p b\u1ea1n t\u00ecm ki\u1ebfm c\u00e1c gi\u00e1 tr\u1ecb trong ph\u1ea1m vi mong mu\u1ed1n, d\u00f9ng c\u00e1c tham s\u1ed1 nh\u01b0 gte (\u2265), lte (\u2264). V\u00ed d\u1ee5, b\u1ea1n c\u00f3 th\u1ec3 t\u00ecm ki\u1ebfm c\u00e1c c\u00f4ng ty \u0111\u01b0\u1ee3c th\u00e0nh l\u1eadp sau n\u0103m 2010 v\u00e0 tr\u01b0\u1edbc n\u0103m 2015 b\u1eb1ng c\u00e1ch th\u1ef1c hi\u1ec7n truy v\u1ea5n sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/companies\/company\/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"range\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"found_year\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"gte\": \"2010-01-01\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"lte\": \"2015-12-31\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"_source\" : [\"name\",\"found_year\"]<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Output:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"took\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"timed_out\" : false,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"_shards\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"successful\" : 1,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"skipped\" : 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"failed\" : 0<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"hits\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"total\" : 2,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"max_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"hits\" : [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"1\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"found_year\" : \"2012-12-28\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Web Technology Company\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_index\" : \"companies\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_type\" : \"company\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_id\" : \"3\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_score\" : 1.0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"_source\" : {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"found_year\" : \"2011-02-10\",<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\" : \"Machine Learning Company\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Huong_dan_toi_uu_hoa_hieu_suat_truy_van_bang_Elasticsearch_Query\"><\/span><b>H\u01b0\u1edbng d\u1eabn t\u1ed1i \u01b0u h\u00f3a hi\u1ec7u su\u1ea5t truy v\u1ea5n b\u1eb1ng Elasticsearch Query<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>S\u1eed d\u1ee5ng filter cho truy v\u1ea5n non-scoring<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Khi b\u1ea1n kh\u00f4ng c\u1ea7n t\u00ednh \u0111i\u1ec3m li\u00ean quan cho k\u1ebft qu\u1ea3 truy v\u1ea5n c\u1ee7a m\u00ecnh, h\u00e3y s\u1eed d\u1ee5ng filter thay v\u00ec lo\u1ea1i match query. Filter nhanh h\u01a1n v\u00ec ch\u00fang kh\u00f4ng th\u1ef1c hi\u1ec7n t\u00ednh to\u00e1n \u0111i\u1ec3m v\u00e0 th\u01b0\u1eddng \u0111\u01b0\u1ee3c l\u01b0u trong b\u1ed9 nh\u1edb \u0111\u1ec7m \u0111\u1ec3 c\u00f3 hi\u1ec7u su\u1ea5t t\u1ed1t h\u01a1n. V\u00ed d\u1ee5: s\u1eed d\u1ee5ng truy v\u1ea5n \u2018bool\u2019 v\u1edbi m\u1ec7nh \u0111\u1ec1 \u2018filter\u2019:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"bool\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"filter\": [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \"term\": { \"status\": \"published\" }},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \"range\": { \"publish_date\": { \"gte\": \"now-1d\" }}}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: K\u1ebft qu\u1ea3 t\u1eeb filter kh\u00f4ng \u1ea3nh h\u01b0\u1edfng b\u1edfi \u0111i\u1ec3m s\u1ed1, n\u00ean ph\u00f9 h\u1ee3p cho c\u00e1c truy v\u1ea5n ch\u1ec9 c\u1ea7n l\u1ecdc ch\u00ednh x\u00e1c.<\/span><\/p>\n<h3><b>Vi\u1ebft l\u1ea1i c\u00e1c truy v\u1ea5n \u0111\u1ec3 c\u00f3 hi\u1ec7u su\u1ea5t t\u1ed1t h\u01a1n<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">M\u1ed9t s\u1ed1 truy v\u1ea5n c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c vi\u1ebft l\u1ea1i \u0111\u1ec3 c\u1ea3i thi\u1ec7n hi\u1ec7u su\u1ea5t m\u00e0 kh\u00f4ng l\u00e0m thay \u0111\u1ed5i k\u1ebft qu\u1ea3. V\u00ed d\u1ee5, truy v\u1ea5n \u2018match_phrase\u2019 c\u00f3 th\u1ec3 ch\u1eadm h\u01a1n truy v\u1ea5n \u2018span_near\u2019 v\u1edbi c\u00f9ng tham s\u1ed1. Thay th\u1ebf truy v\u1ea5n \u2018match_phrase\u2019 b\u1eb1ng truy v\u1ea5n \u2018span_near\u2019:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"span_near\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"clauses\": [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \"span_term\": { \"content\": \"quick\" }},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \"span_term\": { \"content\": \"brown\" }},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \"span_term\": { \"content\": \"fox\" }}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0],<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"slop\": 0,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"in_order\": true<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: span_near hi\u1ec7u qu\u1ea3 h\u01a1n v\u1edbi c\u00e1c c\u1ee5m t\u1eeb g\u1ea7n nhau, nh\u01b0ng ph\u1ee9c t\u1ea1p h\u01a1n v\u00e0 ch\u1ec9 n\u00ean d\u00f9ng khi c\u1ea7n ki\u1ec3m so\u00e1t ch\u1eb7t ch\u1ebd kho\u1ea3ng c\u00e1ch t\u1eeb.<\/span><\/p>\n<h3><b>S\u1eed d\u1ee5ng tham s\u1ed1 search_after \u0111\u1ec3 ph\u00e2n trang<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Khi ph\u00e2n trang qua c\u00e1c t\u1eadp k\u1ebft qu\u1ea3 l\u1edbn, tr\u00e1nh s\u1eed d\u1ee5ng tham s\u1ed1 \u2018from\u2019 v\u00e0 \u2018size\u2019 v\u00ec ch\u00fang c\u00f3 th\u1ec3 g\u00e2y ra s\u1ef1 c\u1ed1 v\u1ec1 hi\u1ec7u su\u1ea5t. Thay v\u00e0o \u0111\u00f3, h\u00e3y s\u1eed d\u1ee5ng tham s\u1ed1 \u2018search_after\u2019 \u0111\u1ec3 ph\u00e2n trang hi\u1ec7u qu\u1ea3 h\u01a1n:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"size\": 10,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": { \"match_all\": {} },<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"sort\": [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0{ \"date\": \"asc\" },<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0{ \"_id\": \"asc\" }<\/span>\n<span style=\"font-weight: 400;\"> \u00a0],<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"search_after\": [\"2022-01-01T00:00:00\", \"doc_id\"]<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: search_after y\u00eau c\u1ea7u tr\u01b0\u1eddng s\u1eafp x\u1ebfp duy nh\u1ea5t (nh\u01b0 _id) \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o k\u1ebft qu\u1ea3 nh\u1ea5t qu\u00e1n.<\/span><\/p>\n<h3><b>T\u1eadn d\u1ee5ng Query Cache<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">B\u1ed9 nh\u1edb \u0111\u1ec7m \u0111\u01b0\u1ee3c b\u1eadt theo m\u1eb7c \u0111\u1ecbnh, v\u00ec v\u1eady vi\u1ec7c l\u01b0u b\u1ed9 nh\u1edb \u0111\u1ec7m s\u1ebd t\u1ea1o ra s\u1ef1 kh\u00e1c bi\u1ec7t n\u1ebfu b\u1ed9 nh\u1edb \u0111\u1ec7m b\u1ecb v\u00f4 hi\u1ec7u h\u00f3a \u1edf c\u1ea5p ch\u1ec9 m\u1ee5c, \u0111\u1ec3 bi\u1ebft th\u00eam th\u00f4ng tin, h\u00e3y theo li\u00ean k\u1ebft n\u00e0y: <\/span><a href=\"https:\/\/stackoverflow.com\/a\/63828533\/3112848\"><span style=\"font-weight: 400;\">https:\/\/stackoverflow.com\/a\/63828533\/3112848<\/span><\/a><span style=\"font-weight: 400;\">. \u0110\u1ec3 t\u1eadn d\u1ee5ng t\u00ednh n\u0103ng n\u00e0y, h\u00e3y s\u1eed d\u1ee5ng tham s\u1ed1 \u2018request_cache\u2019 \u0111\u1ec3 l\u01b0u v\u00e0o b\u1ed9 nh\u1edb \u0111\u1ec7m cho c\u00e1c y\u00eau c\u1ea7u c\u1ee5 th\u1ec3:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/_search?request_cache=true<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"bool\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"filter\": [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \"term\": { \"status\": \"published\" }},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \"range\": { \"publish_date\": { \"gte\": \"now-1d\" }}}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0]<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: Ch\u1ec9 c\u00e1c truy v\u1ea5n filter ho\u1eb7c deterministic (x\u00e1c \u0111\u1ecbnh) m\u1edbi \u0111\u01b0\u1ee3c cache; c\u00e1c truy v\u1ea5n nh\u01b0 now thay \u0111\u1ed5i li\u00ean t\u1ee5c s\u1ebd kh\u00f4ng \u0111\u01b0\u1ee3c l\u01b0u.<\/span><\/p>\n<h3><b>S\u1eed d\u1ee5ng API &#8216;profile&#8217; \u0111\u1ec3 x\u00e1c \u0111\u1ecbnh c\u00e1c slow query<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">API \u2018profile\u2019 c\u00f3 th\u1ec3 gi\u00fap b\u1ea1n x\u00e1c \u0111\u1ecbnh c\u00e1c slow query v\u00e0 hi\u1ec3u c\u00e1c \u0111\u1eb7c \u0111i\u1ec3m hi\u1ec7u su\u1ea5t c\u1ee7a ch\u00fang. Th\u00eam tham s\u1ed1 profile: true v\u00e0o y\u00eau c\u1ea7u t\u00ecm ki\u1ebfm c\u1ee7a b\u1ea1n \u0111\u1ec3 c\u00f3 th\u00f4ng tin h\u1ed3 s\u01a1 chi ti\u1ebft:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GET \/_search<\/span>\n<span style=\"font-weight: 400;\">{<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"profile\": true,<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\"query\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\"match\": {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\"title\": \"elasticsearch\"<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">K\u1ebft qu\u1ea3 tr\u1ea3 v\u1ec1 th\u00f4ng tin chi ti\u1ebft v\u1ec1 th\u1eddi gian th\u1ef1c thi t\u1eebng b\u01b0\u1edbc, gi\u00fap t\u1ed1i \u01b0u truy v\u1ea5n hi\u1ec7u qu\u1ea3 h\u01a1n.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cau_hoi_thuong_gap\"><\/span><b>C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b> S\u1ef1 kh\u00e1c bi\u1ec7t gi\u1eefa query v\u00e0 filter trong Elasticsearch l\u00e0 g\u00ec?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">M\u1ed9t query (truy v\u1ea5n) tham gia v\u00e0o \u0111i\u1ec3m s\u1ed1 (m\u1ee9c \u0111\u1ed9 ph\u00f9 h\u1ee3p c\u1ee7a truy v\u1ea5n v\u1edbi t\u00e0i li\u1ec7u), trong khi filter (b\u1ed9 l\u1ecdc) ch\u1ec9 &#8220;l\u1ecdc&#8221; t\u00e0i li\u1ec7u m\u00e0 kh\u00f4ng t\u00ednh b\u1ea5t k\u1ef3 \u0111i\u1ec3m s\u1ed1 n\u00e0o. V\u1edbi truy v\u1ea5n, b\u1ea1n c\u00f3 th\u1ec3 s\u1eafp x\u1ebfp theo c\u00e1c t\u00e0i li\u1ec7u c\u00f3 li\u00ean quan nh\u1ea5t (h\u00e0nh vi m\u1eb7c \u0111\u1ecbnh). V\u1edbi b\u1ed9 l\u1ecdc, b\u1ea1n ch\u1ec9 c\u00f3 th\u1ec3 n\u00f3i r\u1eb1ng m\u1ed9t t\u00e0i li\u1ec7u c\u00f3 kh\u1edbp hay kh\u00f4ng. B\u1ed9 l\u1ecdc c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c l\u01b0u v\u00e0o b\u1ed9 nh\u1edb \u0111\u1ec7m, c\u00f2n truy v\u1ea5n th\u00ec kh\u00f4ng.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Query<\/b><\/td>\n<td><b>Filter<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Tham gia v\u00e0o \u0111i\u1ec3m s\u1ed1 (m\u1ee9c \u0111\u1ed9 ph\u00f9 h\u1ee3p c\u1ee7a truy v\u1ea5n v\u1edbi t\u00e0i li\u1ec7u).<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Ch\u1ec9 l\u1ecdc t\u00e0i li\u1ec7u m\u00e0 kh\u00f4ng t\u00ednh b\u1ea5t k\u1ef3 \u0111i\u1ec3m s\u1ed1 n\u00e0o.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 s\u1eafp x\u1ebfp theo t\u00e0i li\u1ec7u c\u00f3 li\u00ean quan nh\u1ea5t.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Ch\u1ec9 c\u00f3 th\u1ec3 cho k\u1ebft qu\u1ea3 m\u1ed9t t\u00e0i li\u1ec7u c\u00f3 kh\u1edbp hay kh\u00f4ng.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Kh\u00f4ng l\u01b0u \u0111\u01b0\u1ee3c v\u00e0o b\u1ed9 nh\u1edb \u0111\u1ec7m.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c l\u01b0u v\u00e0o b\u1ed9 nh\u1edb \u0111\u1ec7m.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd: D\u00f9ng filter trong bool khi ch\u1ec9 c\u1ea7n l\u1ecdc, k\u1ebft h\u1ee3p v\u1edbi must n\u1ebfu c\u1ea7n c\u1ea3 \u0111i\u1ec3m s\u1ed1 v\u00e0 l\u1ecdc.<\/span><\/p>\n<h3><b>So s\u00e1nh Elasticsearch v\u1edbi SQL?<\/b><\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>\u0110\u1eb7c tr\u01b0ng<\/b><\/td>\n<td><b>SQL Server<\/b><\/td>\n<td><b>Elasticsearch<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Lo\u1ea1i c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/span><\/td>\n<td><span style=\"font-weight: 400;\">SQL Server l\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7 \u0111\u01b0\u1ee3c ph\u00e1t tri\u1ec3n b\u1edfi Microsoft.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Elasticsearch l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 t\u00ecm ki\u1ebfm v\u00e0 ph\u00e2n t\u00edch.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">C\u1ea5u tr\u00fac d\u1eef li\u1ec7u<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Cho ph\u00e9p l\u01b0u tr\u1eef d\u1eef li\u1ec7u c\u00f3 c\u1ea5u tr\u00fac d\u01b0\u1edbi d\u1ea1ng b\u1ea3ng.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 l\u01b0u tr\u1eef d\u1eef li\u1ec7u b\u00e1n c\u1ea5u tr\u00fac v\u00e0 kh\u00f4ng c\u1ea5u tr\u00fac c\u00f9ng v\u1edbi d\u1eef li\u1ec7u c\u00f3 c\u1ea5u tr\u00fac.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Kh\u1ea3 n\u0103ng m\u1edf r\u1ed9ng<\/span><\/td>\n<td><span style=\"font-weight: 400;\">SQL Server c\u00f3 kh\u1ea3 n\u0103ng m\u1edf r\u1ed9ng h\u1ea1n ch\u1ebf. B\u1ea1n c\u00f3 th\u1ec3 m\u1edf r\u1ed9ng theo chi\u1ec1u d\u1ecdc, nh\u01b0ng c\u00f3 th\u1ec3 ph\u1ee9c t\u1ea1p khi m\u1edf r\u1ed9ng theo chi\u1ec1u ngang.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Elasticsearch c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng m\u1edf r\u1ed9ng theo chi\u1ec1u ngang \u0111\u1ec3 x\u1eed l\u00fd c\u00e1c t\u1eadp d\u1eef li\u1ec7u l\u1edbn.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Hi\u1ec7u su\u1ea5t<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Tu\u00e2n th\u1ee7 ACID v\u00e0 c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng hi\u1ec7u qu\u1ea3 cho c\u00e1c quy tr\u00ecnh giao d\u1ecbch OLTP.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Cho ph\u00e9p t\u00ecm ki\u1ebfm to\u00e0n v\u0103n g\u1ea7n nh\u01b0 theo th\u1eddi gian th\u1ef1c \u0111\u1ec3 t\u1ea1o \u0111i\u1ec1u ki\u1ec7n cho high throughput khi truy v\u1ea5n d\u1eef li\u1ec7u v\u0103n b\u1ea3n.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Ph\u00e2n t\u00edch<\/span><\/td>\n<td><span style=\"font-weight: 400;\">SQL Server gi\u00fap b\u1ea1n ph\u00e2n t\u00edch d\u1eef li\u1ec7u b\u1eb1ng c\u00e1c l\u1ec7nh SQL \u0111\u01a1n gi\u1ea3n.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Elasticsearch h\u1eefu \u00edch cho vi\u1ec7c ph\u00e2n t\u00edch g\u1ea7n nh\u01b0 theo th\u1eddi gian th\u1ef1c tr\u00ean c\u00e1c t\u1eadp d\u1eef li\u1ec7u l\u1edbn.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Chi ph\u00ed<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Phi\u00ean b\u1ea3n Developer v\u00e0 Express mi\u1ec5n ph\u00ed, trong khi b\u1ea1n ph\u1ea3i tr\u1ea3 ph\u00ed \u0111\u1ec3 s\u1eed d\u1ee5ng phi\u00ean b\u1ea3n enterprise, standard v\u00e0 web.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Phi\u00ean b\u1ea3n t\u1ef1 l\u01b0u tr\u1eef l\u00e0 mi\u1ec5n ph\u00ed, trong khi b\u1ea1n ph\u1ea3i tr\u1ea3 ph\u00ed cho 4 phi\u00ean b\u1ea3n c\u00f2n l\u1ea1i (Standard, Gold, Platinum v\u00e0 Enterprise).<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><b>Elasticsearch c\u00f3 nhanh h\u01a1n PostgreSQL kh\u00f4ng?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Elasticsearch \u0111\u01b0\u1ee3c bi\u1ebft \u0111\u1ebfn v\u1edbi kh\u1ea3 n\u0103ng tr\u1ea3 k\u1ebft qu\u1ea3 c\u1ef1c k\u1ef3 t\u1ed1c \u0111\u1ed9 nh\u01b0 t\u00ecm ki\u1ebfm v\u00e0 truy xu\u1ea5t d\u1eef li\u1ec7u g\u1ea7n nh\u01b0 theo th\u1eddi gian th\u1ef1c, khi\u1ebfn n\u00f3 tr\u1edf n\u00ean l\u00fd t\u01b0\u1edfng cho c\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng truy xu\u1ea5t d\u1eef li\u1ec7u nhanh. M\u1eb7c d\u00f9 kh\u00f4ng nhanh b\u1eb1ng Elasticsearch \u0111\u1ed1i v\u1edbi c\u00e1c truy v\u1ea5n li\u00ean quan \u0111\u1ebfn t\u00ecm ki\u1ebfm, nh\u01b0ng PostgreSQL l\u1ea1i c\u1ef1c k\u1ef3 m\u1ea1nh m\u1ebd khi th\u1ef1c hi\u1ec7n c\u00e1c truy v\u1ea5n ph\u1ee9c t\u1ea1p nh\u1edd c\u00e1c thu\u1eadt to\u00e1n t\u1ed1i \u01b0u h\u00f3a v\u00e0 l\u1eadp ch\u1ec9 m\u1ee5c ti\u00ean ti\u1ebfn.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Tong_ket\"><\/span><b>T\u1ed5ng k\u1ebft<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">V\u1edbi kh\u1ea3 n\u0103ng truy v\u1ea5n linh ho\u1ea1t, ph\u00e2n t\u00edch m\u1ea1nh m\u1ebd v\u00e0 t\u1ed1c \u0111\u1ed9 \u1ea5n t\u01b0\u1ee3ng, Elasticsearch Query tr\u1edf th\u00e0nh ng\u01b0\u1eddi b\u1ea1n \u0111\u1ed3ng h\u00e0nh kh\u00f4ng th\u1ec3 thi\u1ebfu c\u1ee7a c\u00e1c chuy\u00ean gia d\u1eef li\u1ec7u v\u00e0 nh\u00e0 ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng. Hy v\u1ecdng nh\u1eefng th\u00f4ng tin ITviec v\u1eeba chia s\u1ebb s\u1ebd gi\u00fap b\u1ea1n kh\u00e1m ph\u00e1 nh\u1eefng b\u00ed k\u00edp \u0111\u1ec3 t\u1eadn d\u1ee5ng t\u1ed1i \u0111a s\u1ee9c m\u1ea1nh c\u1ee7a Elasticsearch Query \u0111\u1ec3 t\u0103ng hi\u1ec7u su\u1ea5t ho\u1ea1t \u0111\u1ed9ng c\u1ee7a \u1ee9ng d\u1ee5ng.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>B\u1ea1n c\u1ea7n m\u1ed9t gi\u1ea3i ph\u00e1p t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c, m\u1ea1nh m\u1ebd v\u00e0 linh ho\u1ea1t? Elasticsearch Query s\u1ebd gi\u00fap b\u1ea1n truy xu\u1ea5t th\u00f4ng tin nhanh ch\u00f3ng t\u1eeb kh\u1ed1i l\u01b0\u1ee3ng d\u1eef li\u1ec7u kh\u1ed5ng l\u1ed3, mang \u0111\u1ebfn kh\u1ea3 n\u0103ng ph\u00e2n t\u00edch d\u1eef li\u1ec7u chuy\u00ean s\u00e2u. B\u00e0i vi\u1ebft n\u00e0y s\u1ebd gi\u00fap b\u1ea1n l\u00e0m quen v\u1edbi c\u00e1c lo\u1ea1i [&hellip;]<\/p>\n","protected":false},"author":205,"featured_media":85400,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-85397","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Elasticsearch Query: Kh\u00e1m ph\u00e1 b\u00ed k\u00edp t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c - ITviec Blog<\/title>\n<meta name=\"description\" content=\"H\u01b0\u1edbng d\u1eabn chi ti\u1ebft c\u00e1c Elasticsearch query t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao, c\u00f9ng b\u00ed k\u00edp t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t truy v\u1ea5n nhanh ch\u00f3ng.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Elasticsearch Query: Kh\u00e1m ph\u00e1 b\u00ed k\u00edp t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c\" \/>\n<meta property=\"og:description\" content=\"B\u1ea1n c\u1ea7n m\u1ed9t gi\u1ea3i ph\u00e1p t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c, m\u1ea1nh m\u1ebd v\u00e0 linh ho\u1ea1t? Elasticsearch Query s\u1ebd gi\u00fap b\u1ea1n truy xu\u1ea5t th\u00f4ng tin nhanh ch\u00f3ng t\u1eeb kh\u1ed1i l\u01b0\u1ee3ng d\u1eef\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-28T11:35:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-17T02:08:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/elasticsearch-query-la-gi-vippro-scaled-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"337\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"H\u00e0 My\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"H\u00e0 My\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Elasticsearch Query: Kh\u00e1m ph\u00e1 b\u00ed k\u00edp t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c - ITviec Blog","description":"H\u01b0\u1edbng d\u1eabn chi ti\u1ebft c\u00e1c Elasticsearch query t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao, c\u00f9ng b\u00ed k\u00edp t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t truy v\u1ea5n nhanh ch\u00f3ng.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/","og_locale":"vi_VN","og_type":"article","og_title":"Elasticsearch Query: Kh\u00e1m ph\u00e1 b\u00ed k\u00edp t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c","og_description":"B\u1ea1n c\u1ea7n m\u1ed9t gi\u1ea3i ph\u00e1p t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c, m\u1ea1nh m\u1ebd v\u00e0 linh ho\u1ea1t? Elasticsearch Query s\u1ebd gi\u00fap b\u1ea1n truy xu\u1ea5t th\u00f4ng tin nhanh ch\u00f3ng t\u1eeb kh\u1ed1i l\u01b0\u1ee3ng d\u1eef","og_url":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2025-03-28T11:35:47+00:00","article_modified_time":"2025-06-17T02:08:16+00:00","og_image":[{"width":640,"height":337,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/elasticsearch-query-la-gi-vippro-scaled-1.jpg","type":"image\/jpeg"}],"author":"H\u00e0 My","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"H\u00e0 My","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"14 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/"},"author":{"name":"H\u00e0 My","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/7bd099db44e5079508c9b7e8c0161e3c"},"headline":"Elasticsearch Query: Kh\u00e1m ph\u00e1 b\u00ed k\u00edp t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c","datePublished":"2025-03-28T11:35:47+00:00","dateModified":"2025-06-17T02:08:16+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/"},"wordCount":3794,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/elasticsearch-query-la-gi-vippro-scaled-1.jpg","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/","url":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/","name":"Elasticsearch Query: Kh\u00e1m ph\u00e1 b\u00ed k\u00edp t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/elasticsearch-query-la-gi-vippro-scaled-1.jpg","datePublished":"2025-03-28T11:35:47+00:00","dateModified":"2025-06-17T02:08:16+00:00","description":"H\u01b0\u1edbng d\u1eabn chi ti\u1ebft c\u00e1c Elasticsearch query t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao, c\u00f9ng b\u00ed k\u00edp t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t truy v\u1ea5n nhanh ch\u00f3ng.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/elasticsearch-query-la-gi-vippro-scaled-1.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/elasticsearch-query-la-gi-vippro-scaled-1.jpg","width":640,"height":337,"caption":"elasticsearch query - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/elasticsearch-query-la-gi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"Elasticsearch Query: Kh\u00e1m ph\u00e1 b\u00ed k\u00edp t\u00ecm ki\u1ebfm d\u1eef li\u1ec7u si\u00eau t\u1ed1c"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/7bd099db44e5079508c9b7e8c0161e3c","name":"H\u00e0 My","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ha-my-author-e1709882319892-100x100.jpeg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ha-my-author-e1709882319892-100x100.jpeg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ha-my-author-e1709882319892-100x100.jpeg","caption":"H\u00e0 My"},"url":"https:\/\/itviec.com\/blog\/author\/ha-my\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/85397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/205"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=85397"}],"version-history":[{"count":2,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/85397\/revisions"}],"predecessor-version":[{"id":88163,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/85397\/revisions\/88163"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/85400"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=85397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=85397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=85397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}