<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>coens TISTORY</title>
    <link>https://c.tistory.com/</link>
    <description></description>
    <language>ko</language>
    <pubDate>Sun, 14 Jun 2026 14:05:35 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>altvirus</managingEditor>
    <item>
      <title>무주향</title>
      <link>https://c.tistory.com/262</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99748F3359E7592712&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99748F3359E7592712&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171018223716.659.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;밀가루가 아니라 보리 수제비&lt;/p&gt;&lt;/div&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/262</guid>
      <comments>https://c.tistory.com/262#entry262comment</comments>
      <pubDate>Wed, 18 Oct 2017 22:37:45 +0900</pubDate>
    </item>
    <item>
      <title>서연의 집</title>
      <link>https://c.tistory.com/261</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9937063359E6D99A21&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9937063359E6D99A21&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171018133322.670.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99B9063359E6D99C07&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99B9063359E6D99C07&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171018133322.178.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9930983359E7596F0C&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9930983359E7596F0C&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171018223837.930.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99E82B3359E7597821&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99E82B3359E7597821&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171018223837.4.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99B61E3359E7598317&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99B61E3359E7598317&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171018223837.750.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9921233359E7599105&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9921233359E7599105&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171018223837.50.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/261</guid>
      <comments>https://c.tistory.com/261#entry261comment</comments>
      <pubDate>Wed, 18 Oct 2017 13:33:33 +0900</pubDate>
    </item>
    <item>
      <title>울산 - 109제면소</title>
      <link>https://c.tistory.com/260</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;생각보다 맛있다. 뽕신 같은 스타일&lt;br&gt;&lt;br&gt;저 해물들 누가 좀 안먹어주나&lt;br&gt;&lt;br&gt;밥을 약간 먹고 싶었는데, 한 공기 전체는 많은듯 하여 참았는데, 다먹고 고개를 드니 셀프코너 밥솥에서 밥을 푸는 사람이 보였다&lt;br&gt;&lt;br&gt;흰짬뽕 빨간짬뽕 두가지&lt;br&gt;&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99C1943359D1B33F26&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99C1943359D1B33F26&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002122842.0.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9945C13359D1B3412E&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9945C13359D1B3412E&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002122842.803.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;&lt;br&gt;&lt;/small&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506916384752&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506916384752&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=109%EC%A0%9C%EB%A9%B4%EC%86%8C&amp;addr=%EC%9A%B8%EC%82%B0%EA%B4%91%EC%97%AD%EC%8B%9C%20%EB%B6%81%EA%B5%AC%20%ED%9A%A8%EB%AC%B8%EB%8F%99&amp;tel=&amp;mapX=1034267&amp;mapY=583614&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=2604056&amp;docid=&amp;confirmid=27351488&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A1034267%2C%22mapCenterY%22%3A583614%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A1034267%2C%22y%22%3A583614%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22109%EC%A0%9C%EB%A9%B4%EC%86%8C%22%2C%22confirmid%22%3A27351488%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/260</guid>
      <comments>https://c.tistory.com/260#entry260comment</comments>
      <pubDate>Mon, 2 Oct 2017 12:32:18 +0900</pubDate>
    </item>
    <item>
      <title>경주 - 슈만과클라라</title>
      <link>https://c.tistory.com/259</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;경주 계획에서 맨 처음 생각했다. 경주에서 중요코스는 불국사가 보다도 여기.&lt;br&gt;&lt;br&gt;메뉴가 자세히 기억은 안나고 막연하게 커피가 참 맛났다는 느낌만 있었다&lt;br&gt;&lt;br&gt;가격은 매우 사악하다. 추천 드립커피라고 있는 곳에 있는 적힌 메뉴들은 모두 만원에 육박. &lt;br&gt;&lt;br&gt;아메리카노와 단팥빵 하나를 먹으니 만원이 넘는다&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/995C4E3359D192190D&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F995C4E3359D192190D&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002100953.180.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/997F173359D1921B0C&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F997F173359D1921B0C&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002100953.508.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9914993359D1921D36&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9914993359D1921D36&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002100953.136.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;&lt;br&gt;&lt;br&gt;&lt;/small&gt;&lt;small&gt;&lt;br&gt;&lt;/small&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506916001451&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506916001451&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%EC%8A%88%EB%A7%8C%EA%B3%BC%ED%81%B4%EB%9D%BC%EB%9D%BC&amp;addr=%EA%B2%BD%EC%83%81%EB%B6%81%EB%8F%84%20%EA%B2%BD%EC%A3%BC%EC%8B%9C%20%EC%84%B1%EA%B1%B4%EB%8F%99&amp;tel=&amp;mapX=997570&amp;mapY=660109&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3702055&amp;docid=&amp;confirmid=7967241&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A997570%2C%22mapCenterY%22%3A660109%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A997570%2C%22y%22%3A660109%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%EC%8A%88%EB%A7%8C%EA%B3%BC%ED%81%B4%EB%9D%BC%EB%9D%BC%22%2C%22confirmid%22%3A7967241%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/259</guid>
      <comments>https://c.tistory.com/259#entry259comment</comments>
      <pubDate>Mon, 2 Oct 2017 10:10:54 +0900</pubDate>
    </item>
    <item>
      <title>울진 - 탈원전 반대</title>
      <link>https://c.tistory.com/258</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99B8AB3359D1911107&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99B8AB3359D1911107&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002100533.644.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/258</guid>
      <comments>https://c.tistory.com/258#entry258comment</comments>
      <pubDate>Mon, 2 Oct 2017 10:06:27 +0900</pubDate>
    </item>
    <item>
      <title>포항 - 지경리 등대</title>
      <link>https://c.tistory.com/257</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99FB053359D1909613&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99FB053359D1909613&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002100334.629.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/997F4E3359D1909817&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F997F4E3359D1909817&quot; width=&quot;820&quot; height=&quot;1409&quot; filename=&quot;171002100334.877.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506906265970&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506906265970&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%EC%9D%BC%EB%B2%88%EC%A7%80%ED%9A%9F%EC%A7%91&amp;addr=%EA%B2%BD%EC%83%81%EB%B6%81%EB%8F%84%20%ED%8F%AC%ED%95%AD%EC%8B%9C%20%EB%B6%81%EA%B5%AC%20%EC%86%A1%EB%9D%BC%EB%A9%B4&amp;tel=&amp;mapX=1033545&amp;mapY=774419&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3701233&amp;docid=&amp;confirmid=9349862&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A1033545%2C%22mapCenterY%22%3A774419%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A1033545%2C%22y%22%3A774419%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%EC%9D%BC%EB%B2%88%EC%A7%80%ED%9A%9F%EC%A7%91%22%2C%22confirmid%22%3A9349862%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/257</guid>
      <comments>https://c.tistory.com/257#entry257comment</comments>
      <pubDate>Mon, 2 Oct 2017 10:04:26 +0900</pubDate>
    </item>
    <item>
      <title>울진 - 흥부시장</title>
      <link>https://c.tistory.com/256</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99E1203359D18CF403&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99E1203359D18CF403&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002094813.541.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9996F83359D18CF637&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9996F83359D18CF637&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002094813.794.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/998EB43359D18CF827&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F998EB43359D18CF827&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002094813.784.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99E4F03359D18CF908&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99E4F03359D18CF908&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002094813.232.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/999E5C3359D18CFB36&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F999E5C3359D18CFB36&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002094813.482.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506905372554&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506905372554&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%ED%9D%A5%EB%B6%80%EA%B3%B5%EC%84%A4%EC%8B%9C%EC%9E%A5&amp;addr=%EA%B2%BD%EC%83%81%EB%B6%81%EB%8F%84%20%EC%9A%B8%EC%A7%84%EA%B5%B0%20%EB%B6%81%EB%A9%B4&amp;tel=&amp;mapX=1027870&amp;mapY=1007881&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3742031&amp;docid=&amp;confirmid=18525638&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A1027870%2C%22mapCenterY%22%3A1007881%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A1027870%2C%22y%22%3A1007881%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%ED%9D%A5%EB%B6%80%EA%B3%B5%EC%84%A4%EC%8B%9C%EC%9E%A5%22%2C%22confirmid%22%3A18525638%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/256</guid>
      <comments>https://c.tistory.com/256#entry256comment</comments>
      <pubDate>Mon, 2 Oct 2017 09:49:01 +0900</pubDate>
    </item>
    <item>
      <title>정동진</title>
      <link>https://c.tistory.com/254</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9967C13359D18BF036&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9967C13359D18BF036&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002094422.268.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/999E153359D18BF232&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F999E153359D18BF232&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171002094422.252.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506905226191&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506905226191&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%EC%A0%95%EB%8F%99%EC%A7%84%EC%97%AD&amp;addr=%EA%B0%95%EC%9B%90%EB%8F%84%20%EA%B0%95%EB%A6%89%EC%8B%9C%20%EA%B0%95%EB%8F%99%EB%A9%B4&amp;tel=&amp;mapX=948230&amp;mapY=1169258&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3203034&amp;docid=&amp;confirmid=1995540275&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A948230%2C%22mapCenterY%22%3A1169258%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A948230%2C%22y%22%3A1169258%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%EC%A0%95%EB%8F%99%EC%A7%84%EC%97%AD%22%2C%22confirmid%22%3A1995540275%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/254</guid>
      <comments>https://c.tistory.com/254#entry254comment</comments>
      <pubDate>Mon, 2 Oct 2017 09:44:35 +0900</pubDate>
    </item>
    <item>
      <title>울진 - 부구리</title>
      <link>https://c.tistory.com/253</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;새벽에 울리는 알람에 잠에 깼다가 짜증스레 다시 자려는데 창밖이 문득 눈에 들어와 큰 용기를 내어 몸을 일으켰다. 일출같은데. 아 여기 동해바다지. &lt;br&gt;&lt;br&gt;참으로 압도적 경관 &lt;br&gt;&lt;br&gt;그러고보니 바닷가 일출은 처음 보는거 같다.&lt;br&gt;아. 해를 보지는 못했지 ㅎㅎ&lt;br&gt;&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99BDB83359D047730D&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99BDB83359D047730D&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;171001103950.160.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99C68B3359D047770A&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99C68B3359D047770A&quot; width=&quot;820&quot; height=&quot;615&quot; filename=&quot;171001103950.599.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506822007982&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506822007982&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%EC%98%88%EC%8A%A4%EB%AA%A8%ED%85%94&amp;addr=%EA%B2%BD%EC%83%81%EB%B6%81%EB%8F%84%20%EC%9A%B8%EC%A7%84%EA%B5%B0%20%EB%B6%81%EB%A9%B4&amp;tel=&amp;mapX=1027812&amp;mapY=1008123&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3742031&amp;docid=&amp;confirmid=27342196&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A1027812%2C%22mapCenterY%22%3A1008123%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A1027812%2C%22y%22%3A1008123%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%EC%98%88%EC%8A%A4%EB%AA%A8%ED%85%94%22%2C%22confirmid%22%3A27342196%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/253</guid>
      <comments>https://c.tistory.com/253#entry253comment</comments>
      <pubDate>Sun, 1 Oct 2017 10:40:08 +0900</pubDate>
    </item>
    <item>
      <title>강릉 - 허균허난설헌기념관</title>
      <link>https://c.tistory.com/252</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;계획에만 있다가 스킵하려던 참이었는데, 순두부 먹고 나오는 길에 이정표가 보여서 이동했다&lt;br&gt;&lt;br&gt;오죽헌보다 여기가 더 좋았다. 담백한 기운이랄까. &lt;br&gt;&lt;br&gt;역시 어느대학인지의 학생놈들이 엄청 시끄럽게 떠들어댔고, 제기차기를 했다. &lt;br&gt;&lt;br&gt;움직이다 보니 어느 가족과 동선이 겹쳐 계속 마주쳤는데, 엄마아빠가 아이에게 이 대단한 남매의 문학얘기를 해주는걸 보며 살짝 웃음이 났다.&lt;br&gt;&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99E2FB3359CF164E25&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99E2FB3359CF164E25&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930125741.81.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9954BF3359CF165822&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9954BF3359CF165822&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930125741.686.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/990FC93359CF16621B&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F990FC93359CF16621B&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930125741.248.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506743907895&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506743907895&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%ED%97%88%EA%B7%A0%ED%97%88%EB%82%9C%EC%84%A4%ED%97%8C%EA%B8%B0%EB%85%90%EA%B4%80&amp;addr=%EA%B0%95%EC%9B%90%EB%8F%84%20%EA%B0%95%EB%A6%89%EC%8B%9C%20%EC%B4%88%EB%8B%B9%EB%8F%99&amp;tel=&amp;mapX=920500&amp;mapY=1196283&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3203059&amp;docid=&amp;confirmid=9617184&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A920500%2C%22mapCenterY%22%3A1196283%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A920500%2C%22y%22%3A1196283%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%ED%97%88%EA%B7%A0%ED%97%88%EB%82%9C%EC%84%A4%ED%97%8C%EA%B8%B0%EB%85%90%EA%B4%80%22%2C%22confirmid%22%3A9617184%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/252</guid>
      <comments>https://c.tistory.com/252#entry252comment</comments>
      <pubDate>Sat, 30 Sep 2017 12:58:28 +0900</pubDate>
    </item>
    <item>
      <title>강릉 - 토박이할머니 순두부</title>
      <link>https://c.tistory.com/251</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;알려진 &quot;토담순두부&quot;는 엄청 기다리고 해야할 것 같아서 여기로 왔다. 아침7시부터 한다는 건 좀 신기했다&lt;br&gt;&lt;span style=&quot;color:#5369BE;&quot;&gt;​&lt;/span&gt;&lt;span style=&quot;color:#5369BE;&quot;&gt;​&lt;/span&gt;​&lt;br&gt;순두부 전골 1인분. 전골이 1인분 주문이 되는건 처음 봤다. 평범한 비쥬얼의 보글보글 뚝배기. 못먹는 어패류 두개를 건져냈다. 칼칼하게 매콤한 만을 내는 고추조각들도 얼른 건졌다. 담백한 순두부맛.&lt;br&gt;&lt;br&gt;깜짝 놀란건 저기 저 하얀 두부. 저게 초두부인가? &quot;초&quot;라는 글자가 들어가므로 당연히 신맛의 음식일 것이라 생각했는데, 깜짝 놀랄만큼 맛있었다.&lt;br&gt;&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9933313359CF147812&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9933313359CF147812&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930124232.771.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99A7B13359CF14821E&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99A7B13359CF14821E&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930124232.485.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9981D23359CF148C17&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9981D23359CF148C17&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930124233.21.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506743437766&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506743437766&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%ED%86%A0%EB%B0%95%EC%9D%B4%ED%95%A0%EB%A8%B8%EB%8B%88%EC%88%9C%EB%91%90%EB%B6%80&amp;addr=%EA%B0%95%EC%9B%90%EB%8F%84%20%EA%B0%95%EB%A6%89%EC%8B%9C%20%EC%B4%88%EB%8B%B9%EB%8F%99&amp;tel=&amp;mapX=921404&amp;mapY=1195519&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3203059&amp;docid=&amp;confirmid=9521756&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A921404%2C%22mapCenterY%22%3A1195519%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A921404%2C%22y%22%3A1195519%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%ED%86%A0%EB%B0%95%EC%9D%B4%ED%95%A0%EB%A8%B8%EB%8B%88%EC%88%9C%EB%91%90%EB%B6%80%22%2C%22confirmid%22%3A9521756%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/251</guid>
      <comments>https://c.tistory.com/251#entry251comment</comments>
      <pubDate>Sat, 30 Sep 2017 12:50:38 +0900</pubDate>
    </item>
    <item>
      <title>강릉 - 오죽헌</title>
      <link>https://c.tistory.com/250</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;생각보다 걍 그랬다. 모든것은 그냥 십수년전 복원판들이고 어느대학인지의 사학과 녀석들이 시끄러웠다. 아. 전남대 옷을 입고들 있었던듯도&lt;br&gt;&lt;br&gt;사실 신사임당에 대한 호기심으로 간 측면이 많은데, 정말 유시민의 말처럼 &quot;여자가 대단하지 않냐?&quot;로 모아지는 멘트들이 좀 그랬다. &lt;br&gt;&lt;br&gt;율곡기념관 건물내에서 본 조충도(로 만든 애니메이션)에 잠시 홀렸었다&lt;br&gt;&lt;br&gt;조경은 참 좋았다&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99A7113359CF112F05&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99A7113359CF112F05&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930123023.467.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9928943359CF11332D&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9928943359CF11332D&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930123023.290.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99FB7C3359CF113A06&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99FB7C3359CF113A06&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930123023.839.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;&lt;br&gt;&lt;/small&gt;&lt;small&gt;&lt;br&gt;&lt;/small&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506742768374&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506742768374&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%EC%98%A4%EC%A3%BD%ED%97%8C&amp;addr=%EA%B0%95%EC%9B%90%EB%8F%84%20%EA%B0%95%EB%A6%89%EC%8B%9C%20%EA%B2%BD%ED%8F%AC%EB%8F%99&amp;tel=&amp;mapX=913474&amp;mapY=1192969&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3203067&amp;docid=&amp;confirmid=25323416&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A913474%2C%22mapCenterY%22%3A1192969%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A913474%2C%22y%22%3A1192969%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%EC%98%A4%EC%A3%BD%ED%97%8C%22%2C%22confirmid%22%3A25323416%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/250</guid>
      <comments>https://c.tistory.com/250#entry250comment</comments>
      <pubDate>Sat, 30 Sep 2017 12:36:27 +0900</pubDate>
    </item>
    <item>
      <title>강릉 - 키크러스 커피</title>
      <link>https://c.tistory.com/249</link>
      <description>&lt;div style=&quot;text-align:left&quot;&gt;&lt;p&gt;검색해서 나오는 산토리니 커피에 이러저러한 혹평이 더러 있어 맘을 고쳐먹고 왔다.&lt;br&gt;&lt;br&gt;배가 불러서 아이스아메 하나만 주문했는데, 커피맛은 그저 그렇다. 스벅이 나을 수도&lt;br&gt;&lt;br&gt;연탄빵 연탄케익이 있는데 연탄같이 생겼다. 가격이 비싸고 혼자 먹을 양이 아니고 싸가서 두고 먹을만한거 같지도 않아 그냥 돌아섰다.  앞 자리 두사람이 먹고 있는데 한개만 주면 안대요?​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 673px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99F23F3359CF0F7A07&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99F23F3359CF0F7A07&quot; width=&quot;673&quot; height=&quot;721&quot; filename=&quot;170930122716.152.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;날씨와 기온은 더할나위 없고 바다는 늘 여기 있다&lt;br&gt;&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/995F7C3359CF16CE22&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F995F7C3359CF16CE22&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930125934.52.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;요로케 보이는 이자리가 마음에 들었다&lt;br&gt;&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9951613359CF0D3E0C&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9951613359CF0D3E0C&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930121906.814.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9968DB3359CF0D4330&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9968DB3359CF0D4330&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930121906.316.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9976B63359CF0D4A03&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9976B63359CF0D4A03&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930121906.600.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99EA243359CF0D4F08&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99EA243359CF0D4F08&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930121906.1.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;&lt;br&gt;&lt;/small&gt;산&lt;br&gt;&lt;br&gt;앞에 여자 머리 무서워&lt;br&gt;​&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 820px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9913BC3359CF19311D&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9913BC3359CF19311D&quot; width=&quot;820&quot; height=&quot;1093&quot; filename=&quot;170930130940.105.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;&lt;br&gt;&lt;/small&gt;&lt;small&gt;&lt;br&gt;&lt;/small&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe id=&quot;emap_1506744672642&quot; src=&quot;/proxy/plusmapViewer.php?id=emap_1506744672642&amp;amp;mapGb=V&quot; width=&quot;484&quot; height=&quot;362&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; mapdata=&quot;map_type=TYPE_MAP&amp;map_hybrid=false&amp;idx=4&amp;title=%ED%82%A4%ED%81%AC%EB%9F%AC%EC%8A%A4%EC%BB%A4%ED%94%BC&amp;addr=%EA%B0%95%EC%9B%90%EB%8F%84%20%EA%B0%95%EB%A6%89%EC%8B%9C%20%EC%86%A1%EC%A0%95%EB%8F%99&amp;tel=&amp;mapX=929444&amp;mapY=1190902&amp;ifrW=484px&amp;ifrH=362px&amp;addtype=1&amp;map_level=4&amp;rcode=3203060&amp;docid=&amp;confirmid=25539662&amp;mapWidth=484&amp;mapHeight=362&amp;mapInfo=%7B%22mapWidth%22%3A484%2C%22mapHeight%22%3A362%2C%22mapCenterX%22%3A929444%2C%22mapCenterY%22%3A1190902%2C%22mapLevel%22%3A4%2C%22coordinate%22%3A%22wcongnamul%22%2C%22markInfo%22%3A%5B%7B%22markerType%22%3A%22standPlace%22%2C%22coordinate%22%3A%22wcongnamul%22%2C%22x%22%3A929444%2C%22y%22%3A1190902%2C%22clickable%22%3Atrue%2C%22draggable%22%3Atrue%2C%22icon%22%3A%7B%22width%22%3A40%2C%22height%22%3A42%2C%22offsetX%22%3A14%2C%22offsetY%22%3A38%2C%22src%22%3A%22http%3A%2F%2Fi1.daumcdn.net%2Flocalimg%2Flocalimages%2F07%2F2012%2Fimg%2Fmarker_p.png%22%7D%2C%22content%22%3A%22%ED%82%A4%ED%81%AC%EB%9F%AC%EC%8A%A4%EC%BB%A4%ED%94%BC%22%2C%22confirmid%22%3A25539662%7D%5D%2C%22graphicInfo%22%3A%5B%5D%2C%22roadviewInfo%22%3A%5B%5D%7D&amp;toJSONString=&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;</description>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/249</guid>
      <comments>https://c.tistory.com/249#entry249comment</comments>
      <pubDate>Sat, 30 Sep 2017 12:20:05 +0900</pubDate>
    </item>
    <item>
      <title>mysql 사용자 생성</title>
      <link>https://c.tistory.com/247</link>
      <description>&lt;p&gt;CREATE USER 'USER'@'11.22.33.44' IDENTIFIED BY 'password';&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;GRANT EXECUTE, PROCESS, SELECT, SHOW DATABASES, SHOW VIEW, ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, EVENT, INDEX, INSERT, REFERENCES, TRIGGER, UPDATE, CREATE USER, FILE, LOCK TABLES, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE, SHUTDOWN, SUPER &amp;nbsp;ON *.* TO 'abcd'@'111.222.333.444' WITH GRANT OPTION;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;FLUSH PRIVILEGES;&lt;/p&gt;</description>
      <category>dev/server</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/247</guid>
      <comments>https://c.tistory.com/247#entry247comment</comments>
      <pubDate>Mon, 24 Aug 2015 09:49:34 +0900</pubDate>
    </item>
    <item>
      <title>wowza 그리고 썸네일 php</title>
      <link>https://c.tistory.com/246</link>
      <description>&lt;p&gt;ffmpeg 썸네일 추출&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 9pt; line-height: 1.5;&quot;&gt;http://stackoverflow.com/questions/10240972/create-thumbnail-image-from-video-in-server-in-php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- flow player&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border: 1px solid rgb(193, 193, 193); padding: 10px; background-color: rgb(238, 238, 238);&quot;&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;1&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-doctype&quot;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;3&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;4&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;    &lt;span class=&quot;html-tag&quot;&gt;&amp;lt;script &lt;span class=&quot;html-attribute-name&quot;&gt;src&lt;/span&gt;=&quot;&lt;a class=&quot;html-attribute-value html-resource-link&quot; target=&quot;_blank&quot; href=&quot;http://releases.flowplayer.org/js/flowplayer-3.2.13.min.js&quot;&gt;http://releases.flowplayer.org/js/flowplayer-3.2.13.min.js&lt;/a&gt;&quot;&amp;gt;&lt;/span&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;5&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;6&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;7&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;8&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;div &lt;span class=&quot;html-attribute-name&quot;&gt;style&lt;/span&gt;=&quot;&lt;span class=&quot;html-attribute-value&quot;&gt;width:640px;height:480px&lt;/span&gt;&quot;&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;9&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;	&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;a &lt;span class=&quot;html-attribute-name&quot;&gt;class&lt;/span&gt;=&quot;&lt;span class=&quot;html-attribute-value&quot;&gt;rtmp&lt;/span&gt;&quot; &lt;span class=&quot;html-attribute-name&quot;&gt;href&lt;/span&gt;=&quot;&lt;a class=&quot;html-attribute-value html-external-link&quot; target=&quot;_blank&quot; href=&quot;mp4:gs.mp4&quot;&gt;mp4:gs.mp4&lt;/a&gt;&quot;&amp;gt;&lt;/span&gt;플레이&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;10&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;11&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;12&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;	&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;13&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;	$f(&quot;a.rtmp&quot;, &quot;http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf&quot;, {
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;14&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;			clip: {
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;15&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;				provider: 'rtmp'
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;16&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;			},
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;17&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;			plugins: {
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;18&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;			  rtmp: {
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;19&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;					url: &quot;flowplayer.rtmp-3.2.13.swf&quot;,
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;20&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;					netConnectionUrl: 'rtmp://v6.cine21.com:1935/coens'
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;21&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;			  }
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;22&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;			}
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;23&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;	});
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;24&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;	&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;25&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;26&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;line-number&quot; value=&quot;27&quot;&gt;&lt;/td&gt;&lt;td class=&quot;line-content&quot;&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;html-end-of-file&quot;&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- jwplayer&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.wowza.com/forums/content.php?484-How-to-use-JW-Player-with-Wowza-Streaming-Engine&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;http://www.wowza.com/forums/content.php?484-How-to-use-JW-Player-with-Wowza-Streaming-Engine&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border: 1px solid rgb(193, 193, 193); padding: 10px; background-color: rgb(238, 238, 238);&quot;&gt;&lt;p&gt;&amp;lt;script src=&quot;http://jwpsrv.com/library/ZbQ8GAUPEeWgDQ4AfQhyIQ.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;div id='playerHaNFsYPqDHYx'&amp;gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;script type='text/javascript'&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; jwplayer('playerHaNFsYPqDHYx').setup({&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file: 'rtmp://v6.cine21.com:1935/coens/mp4:gs.mp4',&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; image: '//www.longtailvideo.com/content/images/jw-player/lWMJeVvV-876.jpg',&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; width: '100%',&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aspectratio: '16:9'&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; });&lt;/p&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;그리고, nimble&lt;/p&gt;&lt;p&gt;http://blog.wmspanel.com/2013/11/streaming-vod-digitalocean-nimble-streamer.html&lt;/p&gt;</description>
      <category>dev/server</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/246</guid>
      <comments>https://c.tistory.com/246#entry246comment</comments>
      <pubDate>Thu, 28 May 2015 17:41:37 +0900</pubDate>
    </item>
    <item>
      <title>리소스</title>
      <link>https://c.tistory.com/245</link>
      <description>&lt;p&gt;개발&lt;/p&gt;</description>
      <category>dev</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/245</guid>
      <comments>https://c.tistory.com/245#entry245comment</comments>
      <pubDate>Tue, 21 Apr 2015 15:16:32 +0900</pubDate>
    </item>
    <item>
      <title>자바 관련 블로그 하나</title>
      <link>https://c.tistory.com/244</link>
      <description>&lt;p&gt;&lt;a href=&quot;http://www.journaldev.com/dev/java/j2ee&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;http://www.journaldev.com/dev/java/j2ee&lt;/a&gt;&lt;/p&gt;</description>
      <category>dev/java</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/244</guid>
      <comments>https://c.tistory.com/244#entry244comment</comments>
      <pubDate>Mon, 20 Apr 2015 12:05:59 +0900</pubDate>
    </item>
    <item>
      <title>자동완성 위한 매핑설정</title>
      <link>https://c.tistory.com/243</link>
      <description>&lt;p&gt;DELETE cine21&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px dotted; height: 1px&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;PUT /cine21&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &quot;settings&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;analysis&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;analyzer&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;korean_analyzer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;custom&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;tokenizer&quot;: &quot;korean_tokenizer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;filter&quot; : [&quot;stop&quot;, &quot;lowercase&quot;, &quot;trim&quot;, &quot;synonym&quot;]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;ngram_analyzer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;custom&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;tokenizer&quot; : &quot;ngram_tokenizer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;filter&quot; : [&quot;lowercase&quot;, &quot;trim&quot;,&quot;synonym&quot;]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;edge_ngram_analyzer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;custom&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;tokenizer&quot; : &quot;edge_ngram_tokenizer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;filter&quot; : [&quot;lowercase&quot;, &quot;trim&quot;,&quot;synonym&quot;]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;tokenizer&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;korean_tokenizer&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot;: &quot;mecab_ko_standard_tokenizer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;compound_noun_min_length&quot;: 100&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;ngram_tokenizer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;nGram&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;min_gram&quot; : &quot;1&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;max_gram&quot; : &quot;5&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;token_chars&quot;: [ &quot;letter&quot;, &quot;digit&quot;, &quot;punctuation&quot;, &quot;symbol&quot; ]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;edge_ngram_tokenizer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;edgeNGram&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;min_gram&quot; : &quot;1&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;max_gram&quot; : &quot;5&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;token_chars&quot;: [ &quot;letter&quot;, &quot;digit&quot;, &quot;punctuation&quot;, &quot;symbol&quot; ]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;filter&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;synonym&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;synonym&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;synonyms&quot; : [&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;탐, 톰&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;플래이어, 플레이어&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; },&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &quot;mappings&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;movie&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;analyzer&quot; : &quot;korean_analyzer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;index_analyzer&quot; : &quot;edge_ngram_analyzer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;search_analyzer&quot; : &quot;edge_ngram_analyzer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;properties&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;title&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot;: &quot;string&quot;,&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;fields&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;h_pf&quot; : {&quot;type&quot; : &quot;string&quot;, &quot;store&quot; : &quot;no&quot;, &quot;index&quot; : &quot;not_analyzed&quot;, &quot;omit_norms&quot; : true, &quot;index_options&quot; : &quot;offsets&quot;, &quot;term_vector&quot; : &quot;with_positions_offsets&quot;, &quot;include_in_all&quot; : false, &quot;boost&quot;: 20},&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;h_ko&quot; : {&quot;type&quot; : &quot;string&quot;, &quot;index_analyzer&quot; : &quot;korean_analyzer&quot;, &quot;boost&quot;: 3},&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;h_ng&quot; : {&quot;type&quot; : &quot;string&quot;, &quot;index_analyzer&quot; : &quot;ngram_analyzer&quot;, &quot;boost&quot;: 1},&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;h_ed&quot; : {&quot;type&quot; : &quot;string&quot;, &quot;index_analyzer&quot; : &quot;edge_ngram_analyzer&quot;, &quot;boost&quot;: 2}&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px dotted; height: 1px&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;GET /cine21/_search&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px dotted; height: 1px&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;GET /cine21/_search&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &quot;query&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;bool&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;should&quot;: [&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&quot;prefix&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;title.h_pf&quot;: &quot;창&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }},{&quot;term&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;title.h_ko&quot;: &quot;창&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }},{&quot;term&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;title.h_ed&quot;: &quot;창&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }},{&quot;term&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;title.h_ng&quot;: &quot;창&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }}&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ],&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;minimum_should_match&quot;: 1&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px solid; border-bottom: black 3px solid; height: 7px&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/es</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/243</guid>
      <comments>https://c.tistory.com/243#entry243comment</comments>
      <pubDate>Mon, 13 Apr 2015 18:08:44 +0900</pubDate>
    </item>
    <item>
      <title>analyzer 테스트</title>
      <link>https://c.tistory.com/242</link>
      <description>&lt;p&gt;curl -XGET 'http://localhost:9200/cine21/_analyze?analyzer=korean_analyzer&amp;amp;pretty=true' -d '멀티플레이어를 자처'&lt;/p&gt;&lt;p&gt;curl -XGET 'http://localhost:9200/cine21/_analyze?analyzer=ngram_analyzer&amp;amp;pretty=true' -d '멀티플레이어를 자처'&lt;/p&gt;&lt;p&gt;curl -XGET 'http://localhost:9200/cine21/_analyze?analyzer=edge_ngram_analyzer&amp;amp;pretty=true' -d '멀티플레이어를 자처'&lt;/p&gt;</description>
      <category>dev/es</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/242</guid>
      <comments>https://c.tistory.com/242#entry242comment</comments>
      <pubDate>Mon, 13 Apr 2015 16:31:14 +0900</pubDate>
    </item>
    <item>
      <title>매핑 설정</title>
      <link>https://c.tistory.com/241</link>
      <description>&lt;p&gt;DELETE cine21&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px solid; height: 1px&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;PUT /cine21&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &quot;settings&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;analysis&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;analyzer&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;korean_analyzer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;custom&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;tokenizer&quot;: &quot;korean_tokenizer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;filter&quot; : [&quot;stop&quot;, &quot;lowercase&quot;, &quot;trim&quot;]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;ngram_analyzer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;custom&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;tokenizer&quot; : &quot;ngram_tokenizer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;filter&quot; : [&quot;lowercase&quot;, &quot;trim&quot;]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;edge_ngram_analyzer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;custom&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;tokenizer&quot; : &quot;edge_ngram_tokenizer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;filter&quot; : [&quot;lowercase&quot;, &quot;trim&quot;]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;tokenizer&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;korean_tokenizer&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot;: &quot;mecab_ko_standard_tokenizer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;compound_noun_min_length&quot;: 100&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;ngram_tokenizer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;nGram&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;min_gram&quot; : &quot;1&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;max_gram&quot; : &quot;5&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;token_chars&quot;: [ &quot;letter&quot;, &quot;digit&quot;, &quot;punctuation&quot;, &quot;symbol&quot; ]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;edge_ngram_tokenizer&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot; : &quot;edgeNGram&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;min_gram&quot; : &quot;1&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;max_gram&quot; : &quot;5&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;token_chars&quot;: [ &quot;letter&quot;, &quot;digit&quot;, &quot;punctuation&quot;, &quot;symbol&quot; ]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; },&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &quot;mappings&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;movie&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;analyzer&quot; : &quot;korean_analyzer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;index_analyzer&quot; : &quot;korean_analyzer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;search_analyzer&quot; : &quot;korean_analyzer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;properties&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;title&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;type&quot;: &quot;string&quot;,&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;fields&quot; : {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;h_ko&quot; : {&quot;type&quot; : &quot;string&quot;, &quot;index_analyzer&quot; : &quot;korean_analyzer&quot;},&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;h_ng&quot; : {&quot;type&quot; : &quot;string&quot;, &quot;index_analyzer&quot; : &quot;ngram_analyzer&quot;},&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;h_ed&quot; : {&quot;type&quot; : &quot;string&quot;, &quot;index_analyzer&quot; : &quot;edge_ngram_analyzer&quot;}&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px solid; height: 1px&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;POST /cine21/movie&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &quot;title&quot; : &quot;멀티플레이어를 자처&quot;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px solid; height: 1px&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;GET /cine21/_search&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px solid; height: 1px&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;GET /cine21/_search&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &quot;query&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;term&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;title.h_ed&quot;: &quot;자&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;hr style=&quot;display:block; border: black 0 none; border-top: black 1px solid; border-bottom: black 3px solid; height: 7px&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;analyzer 테스트&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;color: rgb(0, 0, 0); font-family: dotum; padding-top: 0px !important; padding-bottom: 0px !important;&quot;&gt;curl -XGET 'http://localhost:9200/cine21/_analyze?analyzer=korean_analyzer&amp;amp;pretty=true' -d '멀티플레이어를 자처'&lt;/p&gt;&lt;p style=&quot;color: rgb(0, 0, 0); font-family: dotum; padding-top: 0px !important; padding-bottom: 0px !important;&quot;&gt;curl -XGET 'http://localhost:9200/cine21/_analyze?analyzer=ngram_analyzer&amp;amp;pretty=true' -d '멀티플레이어를 자처'&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-family: dotum; font-size: 9pt; line-height: 1.5;&quot;&gt;curl -XGET 'http://localhost:9200/cine21/_analyze?analyzer=edge_ngram_analyzer&amp;amp;pretty=true' -d '멀티플레이어를 자처'&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/es</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/241</guid>
      <comments>https://c.tistory.com/241#entry241comment</comments>
      <pubDate>Mon, 13 Apr 2015 15:49:21 +0900</pubDate>
    </item>
    <item>
      <title>인스타그램 Feed 가져오기</title>
      <link>https://c.tistory.com/239</link>
      <description>&lt;p&gt;http://www.blueprintinteractive.com/blog/how-instagram-api-fancybox-simplified&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;margin: 0px 0px 20px; padding: 0px 0px 7px; color: rgb(34, 62, 152); font-size: 26px; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: rgb(42, 42, 42); position: relative; font-family: Raleway, sans-serif; line-height: normal;&quot;&gt;Authentication&lt;/h2&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px; font-size: 17px; line-height: 1.5em; color: rgb(54, 54, 54); font-family: Raleway, sans-serif;&quot;&gt;The first thing we need is an access token. Instagram uses OAuth 2.0 protocol for simple, but effective authentication. I could tell you how to retrieve access tokens but then I'd have to kill you (And everything I've done is documented on&amp;nbsp;&lt;a target=&quot;_blank&quot; href=&quot;http://instagram.com/developer/authentication&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(34, 62, 152);&quot;&gt;Instagram's Developer page&lt;/a&gt;). Instead, to make your lives easier, I've provided an easy way for you to attain your access token and user id.&amp;nbsp;&lt;a target=&quot;_blank&quot; href=&quot;https://api.instagram.com/oauth/authorize/?client_id=ab103e54c54747ada9e807137db52d77&amp;amp;redirect_uri=http://blueprintinteractive.com/tutorials/instagram/uri.php&amp;amp;response_type=code&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(34, 62, 152);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Click here to retrieve your access token and user ID&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px; font-size: 17px; line-height: 1.5em; color: rgb(54, 54, 54); font-family: Raleway, sans-serif;&quot;&gt;Instagram has a 5000 request per hour rate limit. This is high in comparison to twitter and similar services so bundling requests to avoid the hitting the limit may not be necessary unless you have high volumes of traffic.&lt;/p&gt;&lt;h2 style=&quot;margin: 0px 0px 20px; padding: 0px 0px 7px; color: rgb(34, 62, 152); font-size: 26px; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: rgb(42, 42, 42); position: relative; font-family: Raleway, sans-serif; line-height: normal;&quot;&gt;Retrieve Images&lt;/h2&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px; font-size: 17px; line-height: 1.5em; color: rgb(54, 54, 54); font-family: Raleway, sans-serif;&quot;&gt;Now we are ready to get our images. See the code below to make this happen. In our example, we are using PHP's CURL library to make our requests.&lt;/p&gt;&lt;div class=&quot;snippet-container&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(54, 54, 54); font-family: Raleway, sans-serif; font-size:12pt; line-height: normal;&quot;&gt;&lt;div class=&quot;sh_acid snippet-wrap&quot; style=&quot;margin: 0px; padding: 0px; border: 0px none; position: relative; background: none;&quot;&gt;&lt;pre class=&quot;php sh_php snippet-formatted sh_sourceCode&quot; style=&quot;margin-top: 0px; margin-bottom: 0px; padding: 20px; color: rgb(0, 0, 0); line-height: 1.8em; overflow: auto; position: relative; border-radius: 15px; background-color: rgb(239, 243, 247);&quot;&gt;&lt;ol class=&quot;snippet-num&quot; style=&quot;margin: 1em 0px 20px 1em; padding: 0px;&quot;&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;  &lt;span class=&quot;sh_keyword&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$url&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sh_cbracket&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;    &lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$ch&lt;/span&gt; &lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;curl_init&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;();&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;    &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;,&lt;/span&gt; CURLOPT_URL&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$url&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;    &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;,&lt;/span&gt; CURLOPT_RETURNTRANSFER&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh_number&quot; style=&quot;margin: 0px; padding: 0px; color: purple; font-weight: 700;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;    &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;,&lt;/span&gt; CURLOPT_TIMEOUT&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh_number&quot; style=&quot;margin: 0px; padding: 0px; color: purple; font-weight: 700;&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;    &lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$result&lt;/span&gt; &lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;curl_exec&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;    &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;curl_close&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;);&lt;/span&gt; &lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;    &lt;span class=&quot;sh_keyword&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;  &lt;span class=&quot;sh_cbracket&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;  &lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$result&lt;/span&gt; &lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_string&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(239, 47, 47);&quot;&gt;&quot;https://api.instagram.com/v1/users/ID-GOES-HERE/media/recent/?access_token=TOKEN-GOES-HERE&quot;&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;  &lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$result&lt;/span&gt; &lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sh_function&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 68, 102);&quot;&gt;json_decode&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;  &lt;span class=&quot;sh_keyword&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;foreach&lt;/span&gt; &lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;-&amp;gt;&lt;/span&gt;data &lt;span class=&quot;sh_keyword&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sh_variable&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(0, 128, 192);&quot;&gt;$post&lt;/span&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sh_cbracket&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;    &lt;span class=&quot;sh_comment&quot; style=&quot;margin: 0px; padding: 0px; color: rgb(92, 122, 218);&quot;&gt;// Do something with this data.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;  &lt;span class=&quot;sh_cbracket&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;margin: 0px 0px 7px 30px; padding: 0px 0px 0px 1.5em; list-style: decimal-leading-zero outside none; font-size: 15px;&quot;&gt;&lt;span class=&quot;sh_symbol&quot; style=&quot;margin: 0px; padding: 0px; color: navy; font-weight: 700;&quot;&gt;?&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br style=&quot;color: rgb(54, 54, 54); font-family: Raleway, sans-serif; font-size:12pt; line-height: normal;&quot;&gt;&lt;/p&gt;&lt;h2 style=&quot;margin: 0px 0px 20px; padding: 0px 0px 7px; color: rgb(34, 62, 152); font-size: 26px; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: rgb(42, 42, 42); position: relative; font-family: Raleway, sans-serif; line-height: normal;&quot;&gt;The Final Product&lt;/h2&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px; font-size: 17px; line-height: 1.5em; color: rgb(54, 54, 54); font-family: Raleway, sans-serif;&quot;&gt;This uses my Instagram account. As you can see, I pretty much never use it. Click on one of the images below to see the Fancybox integration.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/php</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/239</guid>
      <comments>https://c.tistory.com/239#entry239comment</comments>
      <pubDate>Wed, 8 Apr 2015 14:13:17 +0900</pubDate>
    </item>
    <item>
      <title>자주 사용되는 iptables 명령들</title>
      <link>https://c.tistory.com/238</link>
      <description>&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;&amp;nbsp;http://crm.vpscheap.net/knowledgebase.php?action=displayarticle&amp;amp;id=29&lt;/h3&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;1. Delete Existing Rules&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;Before you start building new set of rules, you might want to clean-up all the default rules, and existing rules. Use the iptables flush command as shown below to do this.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -F
(or)
iptables --flush&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;2. Set Default Chain Policies&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The default chain policy is ACCEPT. Change this to DROP for all INPUT, FORWARD, and OUTPUT chains as shown below.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;When you make both INPUT, and OUTPUT chain’s default policy as DROP, for every firewall rule requirement you have, you should define two rules. i.e one for incoming and one for outgoing.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;In all our examples below, we have two rules for each scenario, as we’ve set DROP as default policy for both INPUT and OUTPUT chain.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;If you trust your internal users, you can omit the last line above. i.e Do not DROP all outgoing packets by default. In that case, for every firewall rule requirement you have, you just have to define only one rule. i.e define rule only for incoming, as the outgoing is ACCEPT for all packets.&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;3. Block a Specific ip-address&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;Before we proceed further will other examples, if you want to block a specific ip-address, you should do that first as shown below. Change the “x.x.x.x” in the following example to the specific ip-address that you like to block.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;BLOCK_THIS_IP=&quot;x.x.x.x&quot;
iptables -A INPUT -s &quot;$BLOCK_THIS_IP&quot; -j DROP&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;This is helpful when you find some strange activities from a specific ip-address in your log files, and you want to temporarily block that ip-address while you do further research.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;You can also use one of the following variations, which blocks only TCP traffic on eth0 connection for this ip-address.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -s &quot;$BLOCK_THIS_IP&quot; -j DROP
iptables -A INPUT -i eth0 -p tcp -s &quot;$BLOCK_THIS_IP&quot; -j DROP&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;4. Allow ALL Incoming SSH&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow ALL incoming ssh connections on eth0 interface.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;5. Allow Incoming SSH only from a Sepcific Network&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow incoming ssh connections only from 192.168.100.X network.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp -s 192.168.100.0/24 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;In the above example, instead of /24, you can also use the full subnet mask. i.e “192.168.100.0/255.255.255.0″.&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;6. Allow Incoming HTTP and HTTPS&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow all incoming web traffic. i.e HTTP traffic to port 80.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow all incoming secure web traffic. i.e HTTPS traffic to port 443.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;7. Combine Multiple Rules Together using MultiPorts&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;When you are allowing incoming connections from outside world to multiple ports, instead of writing individual rules for each and every port, you can combine them together using the multiport extension as shown below.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following example allows all incoming SSH, HTTP and HTTPS traffic.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp -m multiport --dports 22,80,443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp -m multiport --sports 22,80,443 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;8. Allow Outgoing SSH&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow outgoing ssh connection. i.e When you ssh from inside to an outside server.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;Please note that this is slightly different than the incoming rule. i.e We allow both the NEW and ESTABLISHED state on the OUTPUT chain, and only ESTABLISHED state on the INPUT chain. For the incoming rule, it is vice versa.&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;9. Allow Outgoing SSH only to a Specific Network&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow outgoing ssh connection only to a specific network. i.e You an ssh only to 192.168.100.0/24 network from the inside.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A OUTPUT -o eth0 -p tcp -d 192.168.100.0/24 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;10. Allow Outgoing HTTPS&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow outgoing secure web traffic. This is helpful when you want to allow internet traffic for your users. On servers, these rules are also helpful when you want to use wget to download some files from outside.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A OUTPUT -o eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;Note: For outgoing HTTP web traffic, add two additional rules like the above, and change 443 to 80.&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;11. Load Balance Incoming Web Traffic&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;You can also load balance your incoming web traffic using iptables firewall rules.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;This uses the iptables nth extension. The following example load balances the HTTPS traffic to three different ip-address. For every 3th packet, it is load balanced to the appropriate server (using the counter 0).&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A PREROUTING -i eth0 -p tcp --dport 443 -m state --state NEW -m nth --counter 0 --every 3 --packet 0 -j DNAT --to-destination 192.168.1.101:443
iptables -A PREROUTING -i eth0 -p tcp --dport 443 -m state --state NEW -m nth --counter 0 --every 3 --packet 1 -j DNAT --to-destination 192.168.1.102:443
iptables -A PREROUTING -i eth0 -p tcp --dport 443 -m state --state NEW -m nth --counter 0 --every 3 --packet 2 -j DNAT --to-destination 192.168.1.103:443&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;12. Allow Ping from Outside to Inside&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow outside users to be able to ping your servers.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;13. Allow Ping from Inside to Outside&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow you to ping from inside to any of the outside servers.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;14. Allow Loopback Access&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;You should allow full loopback access on your servers. i.e access using 127.0.0.1&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;15. Allow Internal Network to External network.&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;On the firewall server where one ethernet card is connected to the external, and another ethernet card connected to the internal servers, use the following rules to allow internal network talk to external network.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;In this example, eth1 is connected to external network (internet), and eth0 is connected to internal network (For example: 192.168.1.x).&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;16. Allow outbound DNS&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow outgoing DNS connections.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A OUTPUT -p udp -o eth0 --dport 53 -j ACCEPT
iptables -A INPUT -p udp -i eth0 --sport 53 -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;17. Allow NIS Connections&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;If you are running NIS to manage your user accounts, you should allow the NIS connections. Even when the SSH connection is allowed, if you don’t allow the NIS related ypbind connections, users will not be able to login.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The NIS ports are dynamic. i.e When the ypbind starts it allocates the ports.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;First do a rpcinfo -p as shown below and get the port numbers. In this example, it was using port 853 and 850.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;rpcinfo -p | grep ypbind&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;Now allow incoming connection to the port 111, and the ports that were used by ypbind.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -p tcp --dport 111 -j ACCEPT
iptables -A INPUT -p udp --dport 111 -j ACCEPT
iptables -A INPUT -p tcp --dport 853 -j ACCEPT
iptables -A INPUT -p udp --dport 853 -j ACCEPT
iptables -A INPUT -p tcp --dport 850 -j ACCEPT
iptables -A INPUT -p udp --dport 850 -j ACCEPT&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The above will not work when you restart the ypbind, as it will have different port numbers that time.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;There are two solutions to this: 1) Use static ip-address for your NIS, or 2) Use some clever shell scripting techniques to automatically grab the dynamic port number from the “rpcinfo -p” command output, and use those in the above iptables rules.&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;18. Allow Rsync From a Specific Network&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allows rsync only from a specific network.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp -s 192.168.101.0/24 --dport 873 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 873 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;19. Allow MySQL connection only from a specific network&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;If you are running MySQL, typically you don’t want to allow direct connection from outside. In most cases, you might have web server running on the same server where the MySQL database runs.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;However DBA and developers might need to login directly to the MySQL from their laptop and desktop using MySQL client. In those case, you might want to allow your internal network to talk to the MySQL directly as shown below.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp -s 192.168.100.0/24 --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 3306 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;20. Allow Sendmail or Postfix Traffic&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow mail traffic. It may be sendmail or postfix.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;21. Allow IMAP and IMAPS&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow IMAP/IMAP2 traffic.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 143 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 143 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow IMAPS traffic.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 993 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 993 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;22. Allow POP3 and POP3S&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow POP3 access.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 110 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 110 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following rules allow POP3S access.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 995 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 995 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;23. Prevent DoS Attack&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following iptables rule will help you prevent the Denial of Service (DoS) attack on your webserver.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -p tcp --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;In the above example:&lt;/p&gt;&lt;ul style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; color: rgb(83, 83, 83); font-family: 'Open Sans', sans-serif; font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;-m limit: This uses the limit iptables extension&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;–limit 25/minute: This limits only maximum of 25 connection per minute. Change this value based on your specific requirement&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;–limit-burst 100: This value indicates that the limit/minute will be enforced only after the total number of connection have reached the limit-burst level.&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;24. Port Forwarding&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;The following example routes all traffic that comes to the port 442 to 22. This means that the incoming ssh connection can come from both port 22 and 422.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -t nat -A PREROUTING -p tcp -d 192.168.102.37 --dport 422 -j DNAT --to 192.168.102.37:22&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;If you do the above, you also need to explicitly allow incoming connection on the port 422.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -i eth0 -p tcp --dport 422 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 422 -m state --state ESTABLISHED -j ACCEPT&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; font-family: Montserrat, Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1.1; margin: 30px 0px 20px; font-size: 24px; background-color: rgb(244, 245, 249);&quot;&gt;25. Log Dropped Packets&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;You might also want to log all the dropped packets. These rules should be at the bottom.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;First, create a new chain called LOGGING.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -N LOGGING&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;Next, make sure all the remaining incoming connections jump to the LOGGING chain as shown below.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A INPUT -j LOGGING&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;Next, log these packets by specifying a custom “log-prefix”.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A LOGGING -m limit --limit 2/min -j LOG --log-prefix &quot;IPTables Packet Dropped: &quot; --log-level 7&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-family: 'Open Sans', Arial, Helvetica, sans-serif; color: rgb(83, 83, 83); font-size: 13px; line-height: 22px; background-color: rgb(244, 245, 249);&quot;&gt;Finally, drop these packets.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; background-color: rgb(245, 245, 245);&quot;&gt;iptables -A LOGGING -j DROP&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/server</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/238</guid>
      <comments>https://c.tistory.com/238#entry238comment</comments>
      <pubDate>Mon, 30 Mar 2015 17:48:55 +0900</pubDate>
    </item>
    <item>
      <title>Intellij + spring mvc</title>
      <link>https://c.tistory.com/237</link>
      <description>&lt;iframe src=&quot;https://www.youtube.com/embed/_SOXs4xdurE&quot; width=&quot;420&quot; height=&quot;315&quot; frameborder=&quot;&quot; allowfullscreen=&quot;true&quot;&gt;&lt;/iframe&gt;</description>
      <category>dev/server</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/237</guid>
      <comments>https://c.tistory.com/237#entry237comment</comments>
      <pubDate>Mon, 23 Mar 2015 15:20:37 +0900</pubDate>
    </item>
    <item>
      <title>elasticsearch 08.매핑</title>
      <link>https://c.tistory.com/235</link>
      <description>&lt;h1 style=&quot;box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; margin-top: 0px !important;&quot;&gt;8. 매핑&lt;/h1&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-81-매핑_mapping-api&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#81-%EB%A7%A4%ED%95%91_mapping-api&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;8.1 매핑(_mapping) API&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.1 books 인덱스의 매핑 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_mapping?pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.2 books/book 인덱스/타입에 read 필드 추가&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books/_mapping/book' -d '
{
  &quot;book&quot; : {
    &quot;properties&quot; : {
      &quot;read&quot; : { &quot;type&quot; : &quot;boolean&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.3 read 필드 추가 후 books 인덱스의 매핑 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_mapping?pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-82-내장필드&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#82-%EB%82%B4%EC%9E%A5%ED%95%84%EB%93%9C&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;8.2 내장필드&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.4 인덱스 생성 시 내장필드 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;PUT &amp;lt;호스트&amp;gt;/&amp;lt;인덱스&amp;gt; -d '
{
  &quot;mappings&quot; : {
    &quot;&amp;lt;타입명&amp;gt;&quot; : {
      &quot;&amp;lt;내장필드명&amp;gt;&quot; : {
        … &amp;lt;필드 내용&amp;gt; …
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.5 인덱스 생성 후 내장필드 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;PUT &amp;lt;호스트&amp;gt;/&amp;lt;인덱스&amp;gt;/_mapping/&amp;lt;타입&amp;gt; -d '
{
  &quot;&amp;lt;타입명&amp;gt;&quot; : {
    &quot;&amp;lt;내장필드명&amp;gt;&quot; : {
      … &amp;lt;필드 내용&amp;gt; …
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-821-_id&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#821-_id&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.2.1 _id&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.6 _id 저장하도록 store 옵션 설정.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;books&quot; : {
    &quot;_id&quot; : {
      &quot;index&quot; : &quot;not_analyzed&quot;,
      &quot;store&quot; : true
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.7 books 인덱스의 id를 title 필드로 설정한 뒤 데이터 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XDELETE 'http://localhost:9200/books'

curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;_id&quot; : { &quot;path&quot; : &quot;title&quot; }
    }
  }
}'

curl -XPOST localhost:9200/_bulk --data-binary @5_1_books.json
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.8 새로 입력된 데이터 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.9 아이디를 이용해서 도큐먼트 조회&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/book/King%20Lear?pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-822-_source&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#822-_source&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.2.2 _source&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.10 books 인덱스의 _source 필드를 enabled : false로 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;_source&quot; : {&quot;enabled&quot; : false}
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.11 검색어 prince로 books 인덱스 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?q=prince&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.12 title, author, category 필드만 저장하도록 지정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;_source&quot; : {
        &quot;includes&quot; : [&quot;title&quot;, &quot;author&quot;, &quot;category&quot;]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.13 검색어 prince로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?q=prince&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.14 p로 시작하는 필드는 저장하지 않도록 지정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;_source&quot; : {
        &quot;excludes&quot; : [&quot;p*&quot;]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.15 검색어 prince로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?q=prince&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-823-_all&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#823-_all&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.2.3 _all&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.16 _all 내장필드를 이용해서 plot 필드는 검색하지 않도록 지정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;_all&quot; : { &quot;enabled&quot; : true },
      &quot;properties&quot; : {
        &quot;title&quot; : {
          &quot;include_in_all&quot; : true,
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;plot&quot; : {
          &quot;include_in_all&quot; : false,
          &quot;type&quot; : &quot;string&quot;
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.17 검색어 prince로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?q=prince&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-824-_analyzer&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#824-_analyzer&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.2.4 _analyzer&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.18 analyze_value 필드의 값을 분석기로 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;_analyzer&quot; : { &quot;path&quot; : &quot; analyze_value&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-825-_timestamp&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#825-_timestamp&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.2.5 _timestamp&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.19 _timestamp 내장필드를 이용해서 타임스탬프 저장&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;_timestamp&quot; : {
        &quot;enabled&quot; : true,
        &quot;store&quot; : true
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.20 검색어 prince로 title 필드와 _timestamp 필드 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XGET 'http://localhost:9200/books/_search?pretty' -d '
{
  &quot;fields&quot; : [ &quot;title&quot; , &quot;_timestamp&quot; ],
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;_all&quot; : &quot;prince&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-826-_ttltime-to-live&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#826-_ttltime-to-live&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.2.6 _ttl(time to live)&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.21 _ttl 내장필드를 이용해서 2일 뒤 데이터가 삭제되도록 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;_ttl&quot; : {
        &quot;enabled&quot; : true,
        &quot;default&quot; : &quot;2d&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-83-데이터-타입&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#83-%EB%8D%B0%EC%9D%B4%ED%84%B0-%ED%83%80%EC%9E%85&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;8.3 데이터 타입&lt;/h2&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-831-문자열&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#831-%EB%AC%B8%EC%9E%90%EC%97%B4&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.1 문자열&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.22 필드 옵션을 적용해서 books 인덱스 매핑 생성&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;properties&quot; : {
        &quot;title&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;boost&quot; : 2.0 },
        &quot;category&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;index&quot; : &quot;not_analyzed&quot; }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.23 title 필드에 boost 2.0 적용 후 prince로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?q=prince&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.24 category 필드를 science로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?q=category:science&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.25 category 필드를 Science fiction으로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?q=category:Science%20fiction&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-832-숫자&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#832-%EC%88%AB%EC%9E%90&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.2 숫자&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.26 num_val 필드의 ignore_malformed 옵션을 true로 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_nums' -d '
{
  &quot;mappings&quot; : {
    &quot;test_num&quot; : {
      &quot;properties&quot; : {
        &quot;num_val&quot; : { &quot;type&quot; : &quot;integer&quot;, &quot;ignore_malformed&quot; : true }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.27 num_val 필드 값에 hello 입력 후 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_nums/test_num/1' -d '
{
  &quot;num_val&quot; : &quot;hello&quot;
}'

curl 'http://localhost:9200/test_nums/test_num/1'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.28 num_val 필드의 통계 페이셋 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/test_nums/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;num_stat&quot; : {
      &quot;statistical&quot; : { &quot;field&quot; : &quot;num_val&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-833-날짜&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#833-%EB%82%A0%EC%A7%9C&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.3 날짜&lt;/h3&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-834-불린&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#834-%EB%B6%88%EB%A6%B0&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.4 불린&lt;/h3&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-835-바이너리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#835-%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.5 바이너리&lt;/h3&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-836-객체&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#836-%EA%B0%9D%EC%B2%B4&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.6 객체&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.29 name, age, married 필드를 가지는 user 필드 값&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;user&quot; : {
    &quot;name&quot; : &quot;Kim&quot;,
    &quot;age&quot; : 30,
    &quot;married&quot; : true
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.30 test_users 인덱스에 객체 타입의 user 필드 매핑 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_users' -d '
{
  &quot;mappings&quot; : {
    &quot;test_user&quot; : {
      &quot;properties&quot; : {
        &quot;user&quot; : {
          &quot;type&quot; : &quot;object&quot;,
          &quot;properties&quot; : {
            &quot;name&quot; : { &quot;type&quot; : &quot;string&quot; },
            &quot;age&quot; : { &quot;type&quot; : &quot;integer&quot; },
            &quot;married&quot; : { &quot;type&quot; : &quot;boolean&quot; }
          }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.31 user 필드에 gender 필드 값을 추가로 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_users/test_user/1' -d '
{
  &quot;user&quot; : {
    &quot;name&quot; : &quot;Kim&quot;, &quot;age&quot; : 30, &quot;married&quot; : true, &quot;gender&quot; : &quot;male&quot;
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.32 test_users 인덱스의 매핑 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/test_users/_mapping?pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.33 dynamic 옵션을 false로 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_users' -d '
{
  &quot;mappings&quot; : {
    &quot;test_user&quot; : {
      &quot;properties&quot; : {
        &quot;user&quot; : {
          &quot;type&quot; : &quot;object&quot;,
          &quot;dynamic&quot; : false,
          &quot;properties&quot; : {
            &quot;name&quot; : { &quot;type&quot; : &quot;string&quot; },
            &quot;age&quot; : { &quot;type&quot; : &quot;integer&quot; },
            &quot;married&quot; : { &quot;type&quot; : &quot;boolean&quot; }
          }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.34 test_users 인덱스의 매핑 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/test_users/_mapping?pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.35 test_users 인덱스의 매핑 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/test_users/_search?pretty' -d '
{
  &quot;fields&quot; : [ &quot;user.name&quot;, &quot;user.age&quot;, &quot;user.married&quot;, &quot;user.gender&quot; ]
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-837-중첩&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#837-%EC%A4%91%EC%B2%A9&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.7 중첩&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.36 user 필드의 name, age, married 하위 필드&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;user&quot; : [
    { &quot;name&quot; : &quot;Kim&quot;, &quot;age&quot; : 30, &quot;married&quot; : true },
    { &quot;name&quot; : &quot;Lee&quot;, &quot;age&quot; : 28, &quot;married&quot; : false }
  ]
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.37 객제 필드의 하위 필드가 실제로 저장되는 형태&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;user.name&quot; : [ &quot;Kim&quot;, &quot;Lee&quot; ],
  &quot;user.age&quot; : [ 30, 28 ],
  &quot;user.married&quot; : [ true, false ]
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.38 test_users 인덱스에 user 필드의 하위 필드 데이터 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_users/test_user/1' -d '
{
  &quot;user&quot; : [
    { &quot;name&quot; : &quot;Kim&quot;, &quot;age&quot; : 30, &quot;married&quot; : true },
    { &quot;name&quot; : &quot;Lee&quot;, &quot;age&quot; : 28, &quot;married&quot; : false }
  ]
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.39 must(AND) 조건으로 user.name : kim, user.age : 28 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/test_users/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;bool&quot; : {
      &quot;must&quot; : [
        { &quot;match&quot; : { &quot;user.name&quot; : &quot;kim&quot; } },
        { &quot;match&quot; : { &quot;user.age&quot; : 28 } }
      ]
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.40 중첩 타입으로 user 필드의 매핑 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_users' -d '
{
  &quot;mappings&quot; : {
    &quot;test_user&quot; : {
      &quot;properties&quot; : {
        &quot;user&quot; : {
          &quot;type&quot; : &quot;nested&quot;,
          &quot;properties&quot; : {
            &quot;name&quot; : { &quot;type&quot; : &quot;string&quot; },
            &quot;age&quot; : { &quot;type&quot; : &quot;integer&quot; },
            &quot;married&quot; : { &quot;type&quot; : &quot;boolean&quot; }
          }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.41 중첩 필드의 하위 필드들이 실제로 저장되는 형태&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;user.name&quot; : &quot;Kim&quot;,
  &quot;user.age&quot; : 30,
  &quot;user.married&quot; : true
},
{
  &quot;user.name&quot; : &quot;Lee&quot;,
  &quot;user.age&quot; : 28,
  &quot;user.married&quot; : false
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.42 nested 질의문 방법&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;nested&quot; : {
    &quot;path&quot; : &amp;lt;중첩 타입의 상위 필드명&amp;gt;,
    &quot;score_mode&quot; : &amp;lt;스코어 방식&amp;gt;,
    &quot;query&quot; : {
      &amp;lt;질의문&amp;gt;
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.43 must(AND) 조건으로 user.name : kim, user.age : 30 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/test_users/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;nested&quot; : {
      &quot;path&quot; : &quot;user&quot;,
      &quot;score_mode&quot; : &quot;avg&quot;,
      &quot;query&quot; : {
        &quot;bool&quot; : {
          &quot;must&quot; : [
            { &quot;match&quot; : { &quot;user.name&quot; : &quot;kim&quot; } },
            { &quot;match&quot; : { &quot;user.age&quot; : 30 } }
          ]
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.44 must(AND) 조건으로 user.name : kim, user.age : 28 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/test_users/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;nested&quot; : {
      &quot;path&quot; : &quot;user&quot;,
      &quot;score_mode&quot; : &quot;avg&quot;,
      &quot;query&quot; : {
        &quot;bool&quot; : {
          &quot;must&quot; : [
            { &quot;match&quot; : { &quot;user.name&quot; : &quot;kim&quot; } },
            { &quot;match&quot; : { &quot;user.age&quot; : 28 } }
          ]
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-838-좌표&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#838-%EC%A2%8C%ED%91%9C&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.8 좌표&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.45 하위 필드 lat, lon의 숫자 값으로 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;lat&quot; : 37.525308,
    &quot;lon&quot; : 126.926644
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.46 문자열로 입력. 위도-경도 순으로 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : &quot;37.525308, 126.926644&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.47 배열로 입력. 경도-위도 순서로 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : [ 126.926644, 37.525308 ]
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.48 위치 해시(geohash) 값으로 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : &quot; wydm2r30v0mm&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.49 test_geos 인덱스의 매핑 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT http://localhost:9200/test_geos/ -d '
{
  &quot;mappings&quot; : {
    &quot;test_geo&quot; : {
      &quot;properties&quot; : {
        &quot;name&quot; : { &quot;type&quot; : &quot;string&quot; },
        &quot;location&quot; : { &quot;type&quot; : &quot;geo_point&quot; }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.50 name, location 값 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_geos/test_geo/1' -d '
{
  &quot;name&quot; : &quot;Conrad Seoul&quot;,
  &quot;location&quot; : &quot;37.525308, 126.926644&quot;
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.51 location 필드의 위도 37.53~37.52, 경도 126.92~126.93 범위의 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/test_geos/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;geo_bounding_box&quot; : {
      &quot;location&quot; : {
        &quot;top_left&quot; : { &quot;lat&quot; : 37.53, &quot;lon&quot; : 126.92 },
        &quot;bottom_right&quot; : { &quot;lat&quot; : 37.52, &quot;lon&quot; : 126.93 }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.52 name, location 값 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/test_geos/test_geo/1' -d '
{
  &quot;name&quot; : &quot;Conrad Seoul&quot;,
  &quot;location&quot; : &quot;37.525308, 486.926644&quot;
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.53 location 필드의 위도 37.53~37.52, 경도 126.92~126.93 범위의 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/test_geos/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;geo_bounding_box&quot; : {
      &quot;location&quot; : {
        &quot;top_left&quot; : { &quot;lat&quot; : 37.53, &quot;lon&quot; : 126.92 },
        &quot;bottom_right&quot; : { &quot;lat&quot; : 37.52, &quot;lon&quot; : 126.93 }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.54 normalize와 validate 옵션을 false로 매핑 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT http://localhost:9200/test_geos/ -d '
{
  &quot;mappings&quot; : {
    &quot;test_geo&quot; : {
      &quot;properties&quot; : {
        &quot;name&quot; : { &quot;type&quot; : &quot;string&quot; },
        &quot;location&quot; : {
          &quot;type&quot; : &quot;geo_point&quot;,
          &quot;normalize&quot; : false,
          &quot;validate&quot; : false
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.55 location 필드의 위도 37.53~37.52, 경도 126.92~126.93 범위의 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/test_geos/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;geo_bounding_box&quot; : {
      &quot;location&quot; : {
        &quot;top_left&quot; : { &quot;lat&quot; : 37.53, &quot;lon&quot; : 126.92 },
        &quot;bottom_right&quot; : { &quot;lat&quot; : 37.52, &quot;lon&quot; : 126.93 }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.56 normalize와 validate 옵션을 false로 매핑 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT http://localhost:9200/test_geos/ -d '
{
  &quot;mappings&quot; : {
    &quot;test_geo&quot; : {
      &quot;properties&quot; : {
        &quot;location&quot; : {
          &quot;type&quot; : &quot;geo_point&quot;
          ,&quot;geohash_prefix&quot; : true
          ,&quot;geohash_precision&quot; : 10
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.57 위치 해시값 wydm2r30v0mm으로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/test_geos/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;filtered&quot; : {
      &quot;query&quot; : {
        &quot;match_all&quot; : {}
      },
      &quot;filter&quot; : {
        &quot;geohash_cell&quot;: { &quot;location&quot;: &quot;wydm2r30v0mm&quot; }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.58 위치 해시값 wydm2r30v 로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/test_geos/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;filtered&quot; : {
      &quot;query&quot; : {
        &quot;match_all&quot; : {}
      },
      &quot;filter&quot; : {
        &quot;geohash_cell&quot;: { &quot;location&quot;: &quot;wydm2r30v&quot; }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-839-위치-모형&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#839-%EC%9C%84%EC%B9%98-%EB%AA%A8%ED%98%95&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.3.9 위치 모형&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.59 location 필드를 geo_shape 타입으로 매핑정보 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT http://localhost:9200/test_geos/ -d '
{
  &quot;mappings&quot; : {
    &quot;test_geo&quot; : {
      &quot;properties&quot; : {
        &quot;location&quot; : {
          &quot;type&quot; : &quot;geo_shape&quot;,
          &quot;precision&quot;: 10
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.60 점. -77.03653, 38.387676 좌표의 점을 나타냄&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot; : &quot;point&quot;,
    &quot;coordinates&quot; : [-77.03653, 38.897676]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.61 선. 좌표 -77.03653, 38.387676에서부터 -77.009051, 38.889939까지 연결된 선을 나타냄&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot; : &quot;linestring&quot;,
    &quot;coordinates&quot; : [[-77.03653, 38.897676], [-77.009051, 38.889939]]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.62 다각형. corrdinates 값은 2차 배열로 되어 있으며 1번째 배열 값은 좌표들을 연결한 형태의 전체 다각형을, 그리고 2번째 배열 값은 좌표들을 연결한 형태의 구멍이 1번째 배열의 다각형 안에 있음을 나타냄&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot; : &quot;polygon&quot;,
    &quot;coordinates&quot; : [
      [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
      [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.63 다중점. 102.0, 2.0 좌표와 103.0, 2.0 좌표 두 개의 점을 나타냄&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot; : &quot;multipoint&quot;,
    &quot;coordinates&quot; : [
      [102.0, 2.0], [103.0, 2.0]
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.64 다중선. 선 배열을 값으로 가지고 있는 2차 배열&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot;: &quot;MultiLineString&quot;,
    &quot;coordinates&quot;: [
      [ [100.0, 0.0], [101.0, 1.0] ],
      [ [102.0, 2.0], [103.0, 3.0] ]
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.65 다중다각형. 다각형 2차 배열을 값으로 가지고 있는 3차 배열&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot; : &quot;multipolygon&quot;,
    &quot;coordinates&quot; : [
      [ [[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]] ],
      [
        [[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],
        [[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]
      ]
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.66 사각형. 두 좌표를 대칭점으로 하는 사각형이다.&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot; : &quot;envelope&quot;,
    &quot;coordinates&quot; : [ [-45.0, 45.0], [45.0, -45.0] ]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.67 원. coordinates 좌표를 중심으로 radius 반지름만큼의 크기를 가진 원을 나타냄&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot; : &quot;circle&quot;,
    &quot;coordinates&quot; : [-45.0, 45.0],
    &quot;radius&quot; : &quot;100m&quot;
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.68 컬렉션. geometries 필드에 서로 다른 위치 형태의 값들을 배열로 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;{
  &quot;location&quot; : {
    &quot;type&quot;: &quot;geometrycollection&quot;,
    &quot;geometries&quot;: [
      {
        &quot;type&quot;: &quot;point&quot;,
        &quot;coordinates&quot;: [100.0, 0.0]
      },
      {
        &quot;type&quot;: &quot;linestring&quot;,
        &quot;coordinates&quot;: [ [101.0, 0.0], [102.0, 1.0] ]
      }
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-84-다중필드&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#84-%EB%8B%A4%EC%A4%91%ED%95%84%EB%93%9C&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;8.4 다중필드&lt;/h2&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-841-다중필드&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#841-%EB%8B%A4%EC%A4%91%ED%95%84%EB%93%9C&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.4.1 다중필드&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.69 title 필드의 다중필드로 raw 필드 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;properties&quot; : {
        &quot;title&quot; : {
          &quot;type&quot; : &quot;string&quot;, &quot;index&quot; : &quot;analyzed&quot;,
          &quot;fields&quot; : {
            &quot;raw&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;index&quot; : &quot;not_analyzed&quot;}
          }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.70 title.raw 필드 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;title.raw&quot; : &quot;The Prince and the Pauper&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-842-토큰-수&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#842-%ED%86%A0%ED%81%B0-%EC%88%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;8.4.2 토큰 수&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.71 title 필드의 토큰 수를 저장하는 tokens 다중 필드&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;properties&quot; : {
        &quot;title&quot; : {
          &quot;type&quot; : &quot;string&quot;, &quot;index&quot; : &quot;analyzed&quot;,
          &quot;fields&quot; : {
            &quot;tokens&quot; : {
              &quot;type&quot; : &quot;token_count&quot;,
              &quot;store&quot; : true,
              &quot;analyzer&quot; : &quot;standard&quot;
            }
          }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.72 title 필드 검색어 the 로 title, title.tokens 필드 출력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?pretty' -d '
{
  &quot;fields&quot; : [&quot;title&quot;, &quot;title.tokens&quot;],
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;title&quot; : &quot;the&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-84-필드-복사&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/08.%EB%A7%A4%ED%95%91#84-%ED%95%84%EB%93%9C-%EB%B3%B5%EC%82%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;8.4 필드 복사&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.73 title, author 필드의 값을 pk_data 필드에 복사&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;properties&quot; : {
        &quot;title&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;copy_to&quot; : &quot;pk_data&quot; },
        &quot;author&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;copy_to&quot; : &quot;pk_data&quot; },
        &quot;pk_data&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;store&quot; : true }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.74 title, author, pk_data 필드 값 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?pretty' -d '
{
  &quot;fields&quot; : [&quot;title&quot;, &quot;author&quot;, &quot;pk_data&quot;],
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;_all&quot; : &quot;prince&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.75 title 필드의 값을 title_1, title_2 필드에 복사&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT 'http://localhost:9200/books' -d '
{
  &quot;mappings&quot; : {
    &quot;book&quot; : {
      &quot;properties&quot; : {
        &quot;title&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;copy_to&quot; : [&quot;title_1&quot;, &quot;title_2&quot;] },
        &quot;title_1&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;store&quot; : true },
        &quot;title_2&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;store&quot; : true }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 8.76 title, title_1, title_2 필드 값 확인&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; margin-bottom: 0px !important; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'http://localhost:9200/books/_search?pretty' -d '
{
  &quot;fields&quot; : [&quot;title&quot;, &quot;title_1&quot;, &quot;title_2&quot;],
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;_all&quot; : &quot;prince&quot; }
  }
}'&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/es</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/235</guid>
      <comments>https://c.tistory.com/235#entry235comment</comments>
      <pubDate>Fri, 13 Mar 2015 17:24:36 +0900</pubDate>
    </item>
    <item>
      <title>elasticsearch 7. 질의(QueryDSL)</title>
      <link>https://c.tistory.com/234</link>
      <description>&lt;h1 style=&quot;box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; margin-top: 0px !important;&quot;&gt;7. 질의(QueryDSL)&lt;/h1&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-71-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#71-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;7.1 쿼리&lt;/h2&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-711-텀-텀즈-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#711-%ED%85%80-%ED%85%80%EC%A6%88-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.1.1 텀, 텀즈 쿼리&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.1 title 필드 값이 prince인 도큐먼트를 텀 쿼리로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : {
      &quot;title&quot; : &quot;prince&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.2 Prince로 검색하면 저장된 텀과 다르므로 결과에 나타나지 않음&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : {
      &quot;title&quot; : &quot;Prince&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.3 텀즈 쿼리를 이용해서 prince, king 텀 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;terms&quot; : {
      &quot;title&quot; : [&quot;prince&quot;,&quot;king&quot;]
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.4 the, and, of 3개의 텀 중 2개 이상을 포함하는 도큐먼트 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;terms&quot; : {
      &quot;title&quot; : [&quot;the&quot;,&quot;and&quot;,&quot;of&quot;],
      &quot;minimum_should_match&quot; : 2
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-712-매치-다중-매치multi-match-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#712-%EB%A7%A4%EC%B9%98-%EB%8B%A4%EC%A4%91-%EB%A7%A4%EC%B9%98multi-match-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.1.2 매치, 다중 매치(multi match) 쿼리&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.5 title 필드를 The And로 매치 쿼리 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;match&quot; : {
      &quot;title&quot; : &quot;The And&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.6 operator를 이용해서 검색 조건을 and로 변경&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;match&quot; : {
      &quot;title&quot; : {
        &quot;query&quot; : &quot;The And&quot;,
        &quot;operator&quot; : &quot;and&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.7 analyzer를 이용해서 질의문에 공백 형태소 적용&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;match&quot; : {
      &quot;title&quot; : {
        &quot;query&quot; : &quot;prince king&quot;,
        &quot;analyzer&quot; : &quot;whitespace&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.8 type: phrase를 사용해 and the 구문을 포함하는 도큐먼트 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;match&quot; : {
      &quot;title&quot; : {
        &quot;query&quot; : &quot;and the&quot;,
        &quot;type&quot; : &quot;phrase&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.9 다중 매치 쿼리를 이용해서 prince king을 title, plot 필드에서 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;multi_match&quot; : {
      &quot;fields&quot; : [ &quot;title&quot; , &quot;plot&quot; ],
      &quot;query&quot; : &quot;prince king&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-713-불-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#713-%EB%B6%88-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.1.3 불 쿼리&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.10 불 쿼리를 이용한 다중 조건 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;bool&quot; : {
      &quot;must&quot; : {
        &quot;term&quot; : { &quot;title&quot; : &quot;the&quot; }
      },
      &quot;must_not&quot; : {
        &quot;term&quot; : { &quot;plot&quot; : &quot;prince&quot; }
      },
      &quot;should&quot; : [
        { &quot;term&quot; : { &quot;title&quot; : &quot;time&quot; } },
        { &quot;term&quot; : { &quot;title&quot; : &quot;world&quot; } }
      ]
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-714-문자열-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#714-%EB%AC%B8%EC%9E%90%EC%97%B4-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.1.4 문자열 쿼리&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.11 문자열 쿼리로 title 필드에서 prince 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;query_string&quot; : {
      &quot;query&quot; : &quot;title:prince&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.12 default_filed, default_operator로 문자열 쿼리 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;query_string&quot; : {
      &quot;query&quot; : &quot;prince king&quot;,
      &quot;default_field&quot; : &quot;plot&quot;,
      &quot;default_operator&quot; : &quot;and&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-715-접두어-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#715-%EC%A0%91%EB%91%90%EC%96%B4-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.1.5 접두어 쿼리&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.13 접두어 쿼리로 질의어 prin 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;prefix&quot; : {
      &quot;title&quot; : &quot;prin&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-716-범위-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#716-%EB%B2%94%EC%9C%84-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.1.6 범위 쿼리&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.14 범위 쿼리로 pages 필드가 50~149인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;range&quot; : {
      &quot;pages&quot; : { &quot;gte&quot; : 50, &quot;lt&quot; : 150 }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.15 범위 쿼리로 written 필드가 1600-01-01 ~ 1699-12-31인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;range&quot; : {
      &quot;written&quot; : {
        &quot;gte&quot; : &quot;1600-01-01&quot;,
        &quot;lt&quot; : &quot;1699-12-31&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-717-전체-매치-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#717-%EC%A0%84%EC%B2%B4-%EB%A7%A4%EC%B9%98-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.1.7 전체 매치 쿼리&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.16 전체 매치 쿼리&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;match_all&quot; : {}
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-718-퍼지-쿼리&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#718-%ED%8D%BC%EC%A7%80-%EC%BF%BC%EB%A6%AC&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.1.8 퍼지 쿼리&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.17 퍼지 쿼리를 이용한 질의어 tree 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;fuzzy&quot; : {
      &quot;title&quot; : &quot;tree&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.18 퍼지 쿼리를 이용해 page 필드가 80~120인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;fuzzy&quot; : {
      &quot;pages&quot; : {
        &quot;value&quot; : 100,
        &quot;fuzziness&quot; : 20
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-72-필터&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#72-%ED%95%84%ED%84%B0&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;7.2 필터&lt;/h2&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-721-텀-텀즈-필터&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#721-%ED%85%80-%ED%85%80%EC%A6%88-%ED%95%84%ED%84%B0&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.2.1 텀, 텀즈 필터&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.19 텀 필터를 이용해서 title 필드가 prince인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;term&quot; : {
      &quot;title&quot; : &quot;prince&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.20 텀즈 필터를 이용해서 title 필드가 prince, king 인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;terms&quot; : {
      &quot;title&quot; : [&quot;prince&quot;, &quot;king&quot;]
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.21 title 필드가 and, the인 값을 execution: and로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;terms&quot; : {
      &quot;title&quot; : [&quot;and&quot;, &quot;the&quot;],
      &quot;execution&quot; : &quot;and&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-722-범위-필터&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#722-%EB%B2%94%EC%9C%84-%ED%95%84%ED%84%B0&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.2.2 범위 필터&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.22 범위 필터로 pages 필드가 50~149인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;range&quot; : {
      &quot;pages&quot; : { &quot;gte&quot; : 50, &quot;lt&quot; : 150 }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-723-and-or-not-필터&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#723-and-or-not-%ED%95%84%ED%84%B0&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.2.3 and, or, not 필터&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.23 not 필터로 pages 필드가 50~149가 아닌 도큐먼트 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;not&quot; : {
      &quot;range&quot; : {
        &quot;pages&quot; : { &quot;gte&quot; : 50, &quot;lt&quot; : 150 }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.24 and 필터로 pages 필드가 50~149이면서 title: the인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;and&quot; : [
      {
        &quot;range&quot; : {
          &quot;pages&quot; : { &quot;gte&quot; : 50, &quot;lt&quot; : 150 }
        }
      },
      {
        &quot;term&quot; : { &quot;title&quot; : &quot;the&quot; }
      }
    ]
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-724-불-필터&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#724-%EB%B6%88-%ED%95%84%ED%84%B0&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.2.4 불 필터&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.25 불 필터를 이용한 다중 조건 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;bool&quot; : {
      &quot;must&quot; : {
        &quot;term&quot; : { &quot;title&quot; : &quot;the&quot; }
      },
      &quot;must_not&quot; : {
        &quot;term&quot; : { &quot;plot&quot; : &quot;prince&quot; }
      },
      &quot;should&quot; : [
        { &quot;term&quot; : { &quot;title&quot; : &quot;time&quot; } },
        { &quot;term&quot; : { &quot;title&quot; : &quot;world&quot; } }
      ]
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-725-위치-필터&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)#725-%EC%9C%84%EC%B9%98-%ED%95%84%ED%84%B0&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;7.2.5 위치 필터&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.26 geo_bounding_box 필터로 사각형 영역의 값을 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;geo_bounding_box&quot; : {
      &quot;location&quot; : {
        &quot;top_left&quot; : { &quot;lat&quot; : 38.00, &quot;lon&quot; : 126.00 },
        &quot;bottom_right&quot; : { &quot;lat&quot; : 37.00, &quot;lon&quot; : 127.00 }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.27 geo_distance 필터로 위도 경도 37.52, 126.98을 중심으로 5km 이내에 있는 도큐먼트 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;geo_distance&quot; : {
      &quot;distance&quot; : &quot;5km&quot;,
      &quot;location&quot; : { &quot;lat&quot; : 37.52, &quot;lon&quot; : 126.98 }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.28 geo_distance_range 필터로 5km~10km 사이에 있는 도큐먼트 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;geo_distance_range&quot; : {
      &quot;from&quot; : &quot;5km&quot;,
      &quot;to&quot; : &quot;10km&quot;,
      &quot;location&quot; : { &quot;lat&quot; : 37.52, &quot;lon&quot; : 126.98 }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 7.29 geo_polygon 필터로 삼각형 영역 사이의 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; margin-bottom: 0px !important; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;filter&quot; : {
    &quot;geo_polygon&quot; : {
      &quot;location&quot; : {
        &quot;points&quot; : [
          { &quot;lat&quot; : 38.00, &quot;lon&quot; : 127.00 },
          { &quot;lat&quot; : 37.00, &quot;lon&quot; : 127.00 },
          { &quot;lat&quot; : 38.00, &quot;lon&quot; : 128.00 }
        ]
      }
    }
  }
}'&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/es</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/234</guid>
      <comments>https://c.tistory.com/234#entry234comment</comments>
      <pubDate>Fri, 13 Mar 2015 16:10:10 +0900</pubDate>
    </item>
    <item>
      <title>elasticsearch 6. 페이셋과 어그리게이션</title>
      <link>https://c.tistory.com/233</link>
      <description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block;   height: auto; max-width: 100%;&quot;&gt;&lt;a href=&quot;https://t1.daumcdn.net/cfile/tistory/22471850550245B126&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;https://i1.daumcdn.net/cfs.tistory/v/0/blog/image/extension/txt.gif&quot; style=&quot;vertical-align: middle;&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;6_1_hotels.json.txt&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;6.1 페이셋&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.1 hotels 인덱스 매핑 설정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPUT http://localhost:9200/hotels/ -d '
{
  &quot;mappings&quot; : {
    &quot;hotel&quot; : {
      &quot;properties&quot; : {
        &quot;name&quot; : { &quot;type&quot; : &quot;string&quot; },
        &quot;stars&quot; : { &quot;type&quot; : &quot;long&quot; },
        &quot;rooms&quot; : { &quot;type&quot; : &quot;long&quot; },
        &quot;location&quot; : { &quot;type&quot; : &quot;geo_point&quot; },
        &quot;city&quot; : { &quot;type&quot; : &quot;string&quot; },
        &quot;address&quot; : { &quot;type&quot; : &quot;string&quot; },
        &quot;internet&quot; : { &quot;type&quot; : &quot;boolean&quot; },
        &quot;service&quot; : { &quot;type&quot; : &quot;string&quot;, &quot;index&quot; : &quot;not_analyzed&quot; },
        &quot;checkin&quot;: { &quot;type&quot; : &quot;date&quot; , &quot;format&quot; : &quot;dateOptionalTime&quot;}
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.2 hotels 인덱스 데이터 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPOST localhost:9200/_bulk --data-binary @6_1_hotels.json
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-611-텀-페이셋&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#611-%ED%85%80-%ED%8E%98%EC%9D%B4%EC%85%8B&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.1.1 텀 페이셋&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.3 service 필드의 텀 페이셋 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;$ curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;name&quot; : &quot;seoul&quot; }
  },
  &quot;facets&quot; : {
    &quot;term_service&quot; : {
      &quot;terms&quot; : {
        &quot;field&quot; : &quot;service&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.4 상위 3개의 텀 페이셋 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;name&quot; : &quot;seoul&quot; }
  },
  &quot;facets&quot; : {
    &quot;term_service&quot; : {
      &quot;terms&quot; : {
        &quot;field&quot; : &quot;service&quot;,
        &quot;size&quot; : 3
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.5 페이셋을 텀의 알파벳 오름차순으로 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;name&quot; : &quot;seoul&quot; }
  },
  &quot;facets&quot; : {
    &quot;term_service&quot; : {
      &quot;terms&quot; : { &quot;field&quot; : &quot;service&quot;, &quot;order&quot; : &quot;term&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-612-범위-페이셋&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#612-%EB%B2%94%EC%9C%84-%ED%8E%98%EC%9D%B4%EC%85%8B&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.1.2 범위 페이셋&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.6 stars 필드의 값을 범위별로 페이셋으로 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;range_stars&quot; : {
      &quot;range&quot; : {
        &quot;field&quot; : &quot;stars&quot;,
        &quot;ranges&quot; : [ {&quot;to&quot;: 3}, {&quot;from&quot;: 3, &quot;to&quot;: 5}, {&quot;from&quot;: 5} ]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.6 stars 필드의 값을 범위별로 페이셋으로 표시 - 2&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;range_service&quot; : {
      &quot;range&quot; : {
        &quot;stars&quot; : [ {&quot;to&quot;: 3}, {&quot;from&quot;: 3, &quot;to&quot;: 5}, {&quot;from&quot;: 5} ]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.7 stars 필드로 간격을 구분하고 price 값을 집계한 페이셋&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;range_stars&quot; : {
      &quot;range&quot; : {
        &quot;key_field&quot; : &quot;stars&quot;,
        &quot;value_field&quot; : &quot;price&quot;,
        &quot;ranges&quot; : [ {&quot;to&quot;: 3}, {&quot;from&quot;: 3, &quot;to&quot;: 5}, {&quot;from&quot;: 5} ]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-613-히스토그램-페이셋&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#613-%ED%9E%88%EC%8A%A4%ED%86%A0%EA%B7%B8%EB%9E%A8-%ED%8E%98%EC%9D%B4%EC%85%8B&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.1.3 히스토그램 페이셋&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.8 rooms 필드의 값을 100 간격으로 구분한 페이셋&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;histo_rooms&quot; : {
      &quot;histogram&quot; : {
        &quot;field&quot; : &quot;rooms&quot;,
        &quot;interval&quot; : 100
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.9 rooms 필드를 100 간격으로 구분하고 price 값을 집계한 페이셋&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;histo_rooms&quot; : {
      &quot;histogram&quot; : {
        &quot;key_field&quot; : &quot;rooms&quot;,
        &quot;value_field&quot; : &quot;price&quot;,
        &quot;interval&quot; : 100
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-614-날짜-히스토그램-페이셋&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#614-%EB%82%A0%EC%A7%9C-%ED%9E%88%EC%8A%A4%ED%86%A0%EA%B7%B8%EB%9E%A8-%ED%8E%98%EC%9D%B4%EC%85%8B&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.1.4 날짜 히스토그램 페이셋&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.10 checkin 필드의 값을 1개월 간격으로 구분한 페이셋&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;histo_checkin&quot; : {
      &quot;date_histogram&quot; : {
        &quot;field&quot; : &quot;checkin&quot;,
        &quot;interval&quot; : &quot;month&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-615-필터와-질의-페이셋&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#615-%ED%95%84%ED%84%B0%EC%99%80-%EC%A7%88%EC%9D%98-%ED%8E%98%EC%9D%B4%EC%85%8B&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.1.5 필터와 질의 페이셋&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.11 텀 페이셋 결과에 service : Spa 필터 적용&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;term_name&quot; : {
      &quot;terms&quot; : { &quot;field&quot; : &quot;service&quot; },
      &quot;facet_filter&quot; : {
        &quot;term&quot; : { &quot;service&quot; : &quot;Spa&quot; }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.12 필터 페이셋을 사용해서 service : Spa인 텀 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;term_filter&quot; : {
      &quot;filter&quot; : {
        &quot;term&quot; : { &quot;service&quot; : &quot;Spa&quot; }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.13 질의 페이셋을 사용해서 name이 seoul 또는 hotel인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;term_query&quot; : {
      &quot;query&quot; : {
        &quot;match&quot; : { &quot;name&quot; : &quot;seoul OR hotel&quot; }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-616-통계-페이셋&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#616-%ED%86%B5%EA%B3%84-%ED%8E%98%EC%9D%B4%EC%85%8B&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.1.6 통계 페이셋&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.14 통계 페이셋을 사용해서 price 필드 정보 출력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;my_facet&quot; : {
      &quot;statistical&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.15 stars 필드별로 price 필드 정보 출력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;my_facet&quot; : {
      &quot;terms_stats&quot; : {
        &quot;key_field&quot; : &quot;stars&quot;,
        &quot;value_field&quot; : &quot;price&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-617-위치-거리-페이셋&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#617-%EC%9C%84%EC%B9%98-%EA%B1%B0%EB%A6%AC-%ED%8E%98%EC%9D%B4%EC%85%8B&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.1.7 위치 거리 페이셋&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.16 geo_distance 페이셋을 이용해 3km, 6km 간격으로 호텔 분리&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;geo&quot; : {
      &quot;geo_distance&quot; : {
        &quot;location&quot; : {
          &quot;lat&quot; : 37.52,
          &quot;lon&quot; : 126.98
        },
        &quot;ranges&quot; : [
          { &quot;to&quot; : 3000 },
          { &quot;from&quot; : 3000, &quot;to&quot; : 6000 },
          { &quot;from&quot; : 6000, &quot;to&quot; : 9000 },
          { &quot;from&quot; : 9000 }
        ]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.17 거리 간격별 price 필드 값 계산&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;geo&quot; : {
      &quot;geo_distance&quot; : {
        &quot;location&quot; : {
          &quot;lat&quot; : 37.52,
          &quot;lon&quot; : 126.98
        },
        &quot;value_field&quot; : &quot;price&quot;,
        &quot;ranges&quot; : [
          { &quot;to&quot; : 3000 },
          { &quot;from&quot; : 3000, &quot;to&quot; : 6000 },
          { &quot;from&quot; : 6000, &quot;to&quot; : 9000 },
          { &quot;from&quot; : 9000 }
        ]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.18 km 단위를 이용해서 거리 간격별 price 필드 값 계산&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;facets&quot; : {
    &quot;geo&quot; : {
      &quot;geo_distance&quot; : {
        &quot;location&quot; : {
          &quot;lat&quot; : 37.52,
          &quot;lon&quot; : 126.98
        },
        &quot;value_field&quot; : &quot;price&quot;,
        &quot;ranges&quot; : [
          { &quot;to&quot; : 3 },
          { &quot;from&quot; : 3, &quot;to&quot; : 6 },
          { &quot;from&quot; : 6, &quot;to&quot; : 9 },
          { &quot;from&quot; : 9 }
        ],
        &quot;unit&quot; : &quot;km&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-62-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#62-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;6.2 어그리게이션&lt;/h2&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-621-최소-최대-합-평균-개수-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#621-%EC%B5%9C%EC%86%8C-%EC%B5%9C%EB%8C%80-%ED%95%A9-%ED%8F%89%EA%B7%A0-%EA%B0%9C%EC%88%98-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.2.1 최소, 최대, 합, 평균, 개수 어그리게이션&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.19 price 필드의 최소(min) 값&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;price_min&quot; : {
      &quot;min&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.20 price 필드의 최대(max) 값&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;price_max&quot; : {
      &quot;max&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.21 price 필드의 합(sum)&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;price_sum&quot; : {
      &quot;sum&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.22 price 필드의 평균(avg)&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;price_avg&quot; : {
      &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.23 price 필드의 개수(value_count)&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;price_cnt&quot; : {
      &quot;value_count&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-622-상태-확장-상태-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#622-%EC%83%81%ED%83%9C-%ED%99%95%EC%9E%A5-%EC%83%81%ED%83%9C-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.2.2 상태, 확장 상태 어그리게이션&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.24 price 필드의 상태 정보&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;price_stats&quot; : {
      &quot;value_stats&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.25 price 필드의 확장 상태 정보&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;price_ex_stats&quot; : {
      &quot;extended_stats&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-623-글로벌-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#623-%EA%B8%80%EB%A1%9C%EB%B2%8C-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.2.3 글로벌 어그리게이션&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.26 name 필드에 seoul을 포함한 도큐먼트의 평균 price&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;name&quot; : &quot;seoul&quot; }
  },
  &quot;aggs&quot; : {
    &quot;avg_price&quot; : {
      &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.27 global 어그리게이션 버킷에 담긴 도큐먼트의 평균 price&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;name&quot; : &quot;seoul&quot; }
  },
  &quot;aggs&quot; : {
    &quot;all_price&quot; : {
      &quot;global&quot; : {},
      &quot;aggs&quot; : {
        &quot;avg_price&quot; : {
          &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-624-필터-누락-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#624-%ED%95%84%ED%84%B0-%EB%88%84%EB%9D%BD-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.2.4 필터, 누락 어그리게이션&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.28 필터 어그리게이션 버킷에 담긴 도큐먼트의 price 평균&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;filter_name&quot; : {
      &quot;filter&quot; : {
        &quot;term&quot; : { &quot;name&quot; : &quot;seoul&quot; }
      },
      &quot;aggs&quot; : {
        &quot;avg_price&quot; : {
          &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.29 service 필드가 존재하지 않는 도큐먼트의 price 평균&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;missing_service&quot; : {
      &quot;missing&quot; : { &quot;field&quot; : &quot;service&quot; },
      &quot;aggs&quot; : {
        &quot;avg_price&quot; : {
          &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-625-텀-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#625-%ED%85%80-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.2.5 텀 어그리게이션&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.30 stars 필드값의 텀별로 price 필드 값 평균 계산&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;term_stars&quot; : {
      &quot;terms&quot; : { &quot;field&quot; : &quot;stars&quot; },
      &quot;aggs&quot; : {
        &quot;avg_price&quot; : {
          &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.31 텀 명으로 내림차순 정렬&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;term_stars&quot; : {
      &quot;terms&quot; : {
        &quot;field&quot; : &quot;stars&quot;,
        &quot;order&quot; : { &quot;_term&quot; : &quot;desc&quot; }
      },
      &quot;aggs&quot; : {
        &quot;avg_price&quot; : {
          &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.32 avg_price 하위 어그리게이션 값으로 오름차순 정렬&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;term_stars&quot; : {
      &quot;terms&quot; : {
        &quot;field&quot; : &quot;stars&quot;,
        &quot;order&quot; : { &quot;avg_price&quot; : &quot;asc&quot; }
      },
      &quot;aggs&quot; : {
        &quot;avg_price&quot; : {
          &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-626-범위-날짜-범위-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#626-%EB%B2%94%EC%9C%84-%EB%82%A0%EC%A7%9C-%EB%B2%94%EC%9C%84-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.2.6 범위, 날짜 범위 어그리게이션&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.33 rooms 필드의 0~500, 500~1000, 1000~ 간격으로 price 평균값 계산&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;range_room&quot; : {
      &quot;range&quot; : {
        &quot;field&quot; : &quot;rooms&quot;,
        &quot;ranges&quot; : [{&quot;to&quot;:500}, {&quot;from&quot;:500, &quot;to&quot;:1000}, {&quot;from&quot;:1000}]
      },
      &quot;aggs&quot; : {
        &quot;avg_price&quot; : {
          &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.34 range 어그리게이션 버킷에 키 속성 추가&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;range_room&quot; : {
      &quot;range&quot; : {
        &quot;field&quot; : &quot;rooms&quot;,
        &quot;keyed&quot; : true,
        &quot;ranges&quot; : [{&quot;to&quot;:500}, {&quot;from&quot;:500, &quot;to&quot;:1000}, {&quot;from&quot;:1000}]
      },
      &quot;aggs&quot; : {
        &quot;avg_price&quot; : {
          &quot;avg&quot; : { &quot;field&quot; : &quot;price&quot; }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.35 date_range 어그리게이션을 이용해서 날짜 범위 구분&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;date_r_checkin&quot; : {
      &quot;date_range&quot; : {
        &quot;field&quot; : &quot;checkin&quot;,
        &quot;format&quot; : &quot;yyyy-MM-dd&quot;,
        &quot;ranges&quot; : [ { &quot;to&quot; : &quot;now-4M&quot; }, { &quot;from&quot; : &quot;now-4M&quot; } ]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.36 date_range 어그리게이션을 이용해서 날짜 범위 구분&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;date_r_checkin&quot; : {
      &quot;date_range&quot; : {
        &quot;field&quot; : &quot;checkin&quot;,
        &quot;format&quot; : &quot;yyyy-MM-dd&quot;,
        &quot;ranges&quot; : [ { &quot;to&quot; : &quot;2014-03-05T12:30:45&quot; }, { &quot;from&quot; : &quot;2014-03-05T12:30:45&quot; } ]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-627-히스토그램-날짜-히스토그램-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#627-%ED%9E%88%EC%8A%A4%ED%86%A0%EA%B7%B8%EB%9E%A8-%EB%82%A0%EC%A7%9C-%ED%9E%88%EC%8A%A4%ED%86%A0%EA%B7%B8%EB%9E%A8-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.2.7 히스토그램, 날짜 히스토그램 어그리게이션&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.37 rooms 필드를 500 간격으로 구분한 히스토그램 어그리게이션&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;histo_rooms&quot; : {
      &quot;histogram&quot; : {
        &quot;field&quot; : &quot;rooms&quot;,
        &quot;interval&quot; : 500
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.38 min_doc_count: 0으로 지정해서 값이 없는 구간 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;histo_rooms&quot; : {
      &quot;histogram&quot; : {
        &quot;field&quot; : &quot;rooms&quot;,
        &quot;interval&quot; : 300,
        &quot;min_doc_count&quot; : 0
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.39 stats 하위 어그리게이션의 sum 값을 오름차순으로 정렬&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;histo_rooms&quot; : {
      &quot;histogram&quot; : {
        &quot;field&quot; : &quot;rooms&quot;,
        &quot;interval&quot; : 300,
        &quot;order&quot; : { &quot;state_rooms.sum&quot; : &quot;asc&quot; }
      },
      &quot;aggs&quot; : {
        &quot;state_rooms&quot; : {
          &quot;stats&quot; : { }
        }
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.40 날짜 히스토그램을 이용해 1개월 간격으로 checkin 필드 구분&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;histo_checkin&quot; : {
      &quot;date_histogram&quot; : {
        &quot;field&quot; : &quot;checkin&quot;,
        &quot;interval&quot; : &quot;1M&quot;,
        &quot;format&quot; : &quot;yyyy-MM-dd E&quot;
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-628-위치-거리-위치-해시-그리드-어그리게이션&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/06.%ED%8E%98%EC%9D%B4%EC%85%8B%EA%B3%BC_%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98#628-%EC%9C%84%EC%B9%98-%EA%B1%B0%EB%A6%AC-%EC%9C%84%EC%B9%98-%ED%95%B4%EC%8B%9C-%EA%B7%B8%EB%A6%AC%EB%93%9C-%EC%96%B4%EA%B7%B8%EB%A6%AC%EA%B2%8C%EC%9D%B4%EC%85%98&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;6.2.8 위치 거리, 위치 해시 그리드 어그리게이션&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.41 3km 간격으로 위치 거리 어그리게이션 버킷 구분&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;geo_location&quot; : {
      &quot;geo_distance&quot; : {
        &quot;field&quot; : &quot;location&quot;,
        &quot;origin&quot; : &quot;37.52, 126.98&quot;,
        &quot;distance_type&quot; : &quot;plane&quot;,
        &quot;unit&quot; : &quot;km&quot;,
        &quot;ranges&quot; : [{&quot;to&quot;:3},{&quot;from&quot;:3,&quot;to&quot;:6},{&quot;from&quot;:6,&quot;to&quot;:9},{&quot;from&quot;:9}]
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.42 precision: 5 정밀도 값으로 위치 해시 그리드 구분&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;geohash_location&quot; : {
      &quot;geohash_grid&quot; : {
        &quot;field&quot; : &quot;location&quot;,
        &quot;precision&quot; : 5
      }
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 6.43 위도: 37~38 / 경도: 126~128에 속하는 도큐먼트 필터링&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; margin-bottom: 0px !important; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/hotels/_search?pretty' -d '
{
  &quot;aggs&quot; : {
    &quot;geohash_filter&quot; : {
      &quot;filter&quot; : {
        &quot;geo_bounding_box&quot; : {
          &quot;location&quot; : {
            &quot;top_left&quot; : &quot;38.00, 126.00&quot;,
            &quot;bottom_right&quot; : &quot;37.00, 127.00&quot;
          }
        }
      },
      &quot;aggs&quot; : {
        &quot;geoghash_location&quot; : {
          &quot;geohash_grid&quot; : {
            &quot;field&quot; : &quot;location&quot;,
            &quot;precision&quot; : 5
          }
        }
      }
    }
  }
}'&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/es</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/233</guid>
      <comments>https://c.tistory.com/233#entry233comment</comments>
      <pubDate>Fri, 13 Mar 2015 11:01:14 +0900</pubDate>
    </item>
    <item>
      <title>elasticsearch 5. 검색</title>
      <link>https://c.tistory.com/232</link>
      <description>&lt;h1 style=&quot;box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; margin-top: 0px !important;&quot;&gt;5. 검색&lt;/h1&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.1 5_1_books.json 파일 내용을 벌크 API로 입력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl -XPOST localhost:9200/_bulk --data-binary @5_1_books.json

curl -XPOST localhost:9200/_bulk --data-binary @5_2_magazines.json
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-51-검색_search-api&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#51-%EA%B2%80%EC%83%89_search-api&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;5.1 검색(_search) API&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.2 books 인덱스, book 타입에서 hamlet 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/book/_search?q=hamlet&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.3 books 인덱스에서 hamlet 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?q=hamlet&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.4 books, magazines 인덱스에서 time 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books,magazines/_search?q=time&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.5 _all을 사용해 전체 인덱스에서 time 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_all/_search?q=time&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.6 인덱스 지정을 생략해 전체 인덱스에서 time 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?q=time&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-52-uri-검색&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#52-uri-%EA%B2%80%EC%83%89&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;5.2 URI 검색&lt;/h2&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-521-qquery&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#521-qquery&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.1 q(query)&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.7 전체 인덱스의 title 필드에서 time 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?q=title:time&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.8 title 필드에 검색어 time과 machine을 AND 조건으로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?q=title:time%20AND%20machine&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-522-dfdefault-field&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#522-dfdefault-field&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.2 df(default field)&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.9 df 매개변수를 사용해서 title 필드에서 time 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?q=time&amp;amp;df=title&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-523-default_operator&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#523-default_operator&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.3 default_operator&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.10 default_operator 매개변수를 사용해서 기본 조건 명령어를 AND로 지정&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?q=title:time%20machine&amp;amp;default_operator=AND&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-524-explain&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#524-explain&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.4 explain&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.11 explain 매개변수를 사용해서 검색 처리 결과 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?q=title:time&amp;amp;explain&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-525-_source&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#525-_source&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.5 _source&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.12 _source 매개변수를 false로 설정해 도큐먼트 내용을 배제하고 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?q=title:time&amp;amp;_source=false&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-526-fields&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#526-fields&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.6 fields&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.13 fields 매개변수를 사용해 title, author, category 필드만 출력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?q=title:time&amp;amp;fields=title,author,category&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-527-sort&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#527-sort&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.7 sort&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.14 author 필드가 jules인 도큐먼트를 pages 필드를 기준으로 오름차순 정렬&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?q=author:jules&amp;amp;sort=pages&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.15 author 필드가 jules인 도큐먼트를 pages 필드를 기준으로 내림차순 정렬&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?q=author:jules&amp;amp;sort=pages:desc&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.16 author 필드가 jules인 도큐먼트를 title 필드를 기준으로 오름차순 정렬&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?q=author:jules&amp;amp;fields=title&amp;amp;sort=title&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.17 author 필드가 jules인 도큐먼트를 title 필드를 기준으로 내림차순 정렬&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?q=author:jules&amp;amp;fields=title&amp;amp;sort=title:desc&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-528-timeout&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#528-timeout&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.8 timeout&lt;/h3&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-529-from&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#529-from&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.9 from&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.18 from 매개변수를 사용해서 2번째 결과부터 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?q=author:jules&amp;amp;fields=title&amp;amp;from=1&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-5210-size&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#5210-size&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.10 size&lt;/h3&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-5211-search_type&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#5211-search_type&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.2.11 search_type&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.19 search_type=query_then_fetch로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?size=1&amp;amp;q=author:William&amp;amp;search_type=query_then_fetch&amp;amp;fields=title,author&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.20 search_type=query_and_fetch로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?size=1&amp;amp;q=author:William&amp;amp;search_type=query_and_fetch&amp;amp;fields=title,author&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.21 search_type=scan으로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?q=author:william&amp;amp;fields=title,author&amp;amp;search_type=scan&amp;amp;scroll=10m&amp;amp;pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.22 _scroll_id로 검색한 결과 출력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search/scroll/c2Nhbjs1OzUxOnpnazlUWENRUTJ5TURiU3BfUGlLQXc7NTI6emdrOVRYQ1FRMnlNRGJTcF9QaUtBdzs1Mzp6Z2s5VFhDUVEyeU1EYlNwX1BpS0F3OzUxOjhsZlJpemZIVDQ2R1JvZjR3SHdWcmc7NTI6OGxmUml6ZkhUNDZHUm9mNHdId1ZyZzsxO3RvdGFsX2hpdHM6Njs=?pretty'
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-53-리퀘스트-바디-검색&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#53-%EB%A6%AC%ED%80%98%EC%8A%A4%ED%8A%B8-%EB%B0%94%EB%94%94-%EA%B2%80%EC%83%89&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1; background: transparent;&quot;&gt;&lt;/a&gt;5.3 리퀘스트 바디 검색&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.23 리퀘스트 바디로 author 값이 william인 값 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;author&quot; : &quot;william&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-531-size-from-fields&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#531-size-from-fields&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.3.1 size, from, fields&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.24 from:1, size:2, fields:[“title”,”category”] 조건으로 전체 필드에서 time 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?pretty' -d '
{
  from : 1,
  size : 2,
  fields : [&quot;title&quot;,&quot;category&quot;],
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;_all&quot; : &quot;time&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-532-sort&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#532-sort&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.3.2 sort&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.25 category - 내림차순, pages, title - 오름차순 순서로 검색 결과 정렬&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;fields&quot; : [&quot;title&quot;,&quot;author&quot;,&quot;category&quot;,&quot;pages&quot;],
  &quot;sort&quot; : [{&quot;category&quot;:&quot;desc&quot;},&quot;pages&quot;,&quot;title&quot;],
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;_all&quot; : &quot;time&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.26 category mode: min으로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;fields&quot;: [&quot;title&quot;,&quot;author&quot;,&quot;category&quot;,&quot;pages&quot;],
  &quot;sort&quot;: [{&quot;category&quot;:{&quot;order&quot;:&quot;desc&quot;,&quot;mode&quot;:&quot;min&quot;}},&quot;pages&quot;,&quot;title&quot;],
  &quot;query&quot;: {
    &quot;term&quot;: { &quot;category&quot; : &quot;science&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.27 category mode: max로 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;fields&quot;: [&quot;title&quot;,&quot;author&quot;,&quot;category&quot;,&quot;pages&quot;],
  &quot;sort&quot;: [{&quot;category&quot;:{&quot;order&quot;:&quot;desc&quot;,&quot;mode&quot;:&quot;max&quot;}},&quot;pages&quot;,&quot;title&quot;],
  &quot;query&quot;: {
    &quot;term&quot;: { &quot;category&quot; : &quot;science&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.28 title, author 필드로 정렬. author 필드가 없어서 검색 실패&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?pretty' -d '
{
  &quot;fields&quot; : [&quot;title&quot;,&quot;author&quot;,&quot;category&quot;],
  &quot;sort&quot; : [&quot;title&quot;,&quot;author&quot;],
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;title&quot; : &quot;time&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.29 ignore_unmapped를 true로 설정. author 필드가 없이도 검색 성공&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?pretty' -d '
{
  &quot;fields&quot; : [&quot;title&quot;,&quot;author&quot;,&quot;category&quot;],
  &quot;sort&quot; : [&quot;title&quot;,{&quot;author&quot;:{&quot;ignore_unmapped&quot; : true}}],
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;title&quot; : &quot;time&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.30 track_scores를 true로 설정. 점수 정보 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/_search?pretty' -d '
{
  &quot;fields&quot; : [&quot;title&quot;,&quot;author&quot;,&quot;category&quot;],
  &quot;sort&quot; : [&quot;title&quot;,{&quot;author&quot;:{&quot;ignore_unmapped&quot; : true}}],
  &quot;track_scores&quot;: true,
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;title&quot; : &quot;time&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-533-_source&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#533-_source&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.3.3 _source&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.31 _source: false로 설정해 도큐먼트 내용은 보이지 않게 검색&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;_source&quot;: false,
  &quot;query&quot;: {
    &quot;term&quot;: { &quot;author&quot;: &quot;william&quot; }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.32 _source를 이용해서 title과 c로 시작하는 필드명의 값 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/magazines/_search?pretty' -d '
{
  &quot;_source&quot;: [&quot;title&quot;,&quot;c*&quot;]
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.33 c로 시작하면서 ry로 끝나지 않는 필드 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/magazines/_search?pretty' -d '
{
  &quot;_source&quot;: {
    &quot;include&quot;: &quot;c*&quot;,
    &quot;exclude&quot; : &quot;*ry&quot;
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-534-partial_fields-fielddata_fields&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#534-partial_fields-fielddata_fields&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.3.4 partial_fields, fielddata_fields&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.34 title, category 필드 출력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/magazines/_search?pretty' -d '
{
  &quot;fields&quot;:[&quot;title&quot;,&quot;category&quot;]
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.35 c로 시작하면서 ry로 끝나지 않는 필드 표시&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/magazines/_search?pretty' -d '
{
  &quot;partial_fields&quot; : {
    &quot;partial_1&quot; : {
      &quot;include&quot; : &quot;c*&quot;,
      &quot;exclude&quot; : &quot;*ry&quot;
    }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.36 fielddata_fields를 사용해서 title, category 필드 출력&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/magazines/_search?pretty' -d '
{
  &quot;fielddata_fields&quot; : [&quot;title&quot;, &quot;category&quot;]
}'
&lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-535-highlight&quot; class=&quot;anchor&quot; href=&quot;https://github.com/wikibook/elasticsearch/tree/master/05.%EA%B2%80%EC%83%89#535-highlight&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: inherit; position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;5.3.5 highlight&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.37 author 필드의 검색어 william 강조&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 16px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;author&quot; : &quot;william&quot; }
  },
  &quot;highlight&quot; : {
    &quot;fields&quot; : { &quot;author&quot; : {} }
  }
}'
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;예제 5.38 strong 태그를 이용해 author 필드의 검색어 william 강조&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; margin-bottom: 0px !important; background-color: rgb(247, 247, 247);&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; max-width: initial; overflow: initial; line-height: inherit; word-wrap: normal; background: transparent;&quot;&gt;curl 'localhost:9200/books/_search?pretty' -d '
{
  &quot;query&quot; : {
    &quot;term&quot; : { &quot;author&quot; : &quot;william&quot; }
  },
  &quot;highlight&quot; : {
    &quot;pre_tags&quot; : [&quot;&amp;lt;strong&amp;gt;&quot;],
    &quot;post_tags&quot; : [&quot;&amp;lt;/strong&amp;gt;&quot;],
    &quot;fields&quot; : { &quot;author&quot; : { } }
  }
}'&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/es</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/232</guid>
      <comments>https://c.tistory.com/232#entry232comment</comments>
      <pubDate>Fri, 13 Mar 2015 00:39:29 +0900</pubDate>
    </item>
    <item>
      <title>PHP MySQLi Database Class</title>
      <link>https://c.tistory.com/231</link>
      <description>&lt;p&gt;템플릿 같은거 있으면 좋긴 할텐데;;;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://github.com/joshcam/PHP-MySQLi-Database-Class&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;Initialization&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;To utilize this class, first import MysqliDb.php into your project, and require it.&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;require_once&lt;/span&gt; (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;MysqliDb.php&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;After that, create a new instance of the class.&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;MysqliDb&lt;/span&gt; (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;host&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;username&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;password&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;databaseName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Its also possible to set a table prefix:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;setPrefix (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;my_&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Next, prepare your data, and call the necessary methods.&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-insert-query&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#insert-query&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Insert Query&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Simple example&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$data&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt; (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;login&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;admin&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;               &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;firstName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;John&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;               &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;lastName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;Doe&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$id&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;insert(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$data&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;if&lt;/span&gt;(&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$id&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;user was created. Id=&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$id&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Insert with functions use&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$data&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt;(&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;login&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;admin&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;active&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;true&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;firstName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;John&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;lastName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;Doe&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;password&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;func(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;SHA1(?)&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt; (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;secretpassword+salt&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;)),&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// password = SHA1('secretpassword+salt')&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;createdAt&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;now(),&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// createdAt = NOW()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;expires&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;now(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;+1Y&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// expires = NOW() + interval 1 year&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Supported intervals [s]econd, [m]inute, [h]hour, [d]day, [M]onth, [Y]ear&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$id&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;insert (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$data&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$id&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;user was created. Id=&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$id&lt;/span&gt;;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;else&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;insert failed: &lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;getLastError();&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-update-query&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#update-query&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Update Query&lt;/h3&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$data&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt; (&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;firstName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;Bobby&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;lastName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;Tables&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;editCount&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;inc(&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;2&lt;/span&gt;),&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// editCount = editCount + 2;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;active&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;not()&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// active = !active;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;update (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$data&lt;/span&gt;))&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt; records were updated&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;else&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;update failed: &lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;getLastError();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-select-query&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#select-query&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Select Query&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;After any select/get function calls amount or returned rows is stored in $count variable&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$users&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;); &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;//contains an Array of all users &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$users&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;10&lt;/span&gt;); &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;//contains an Array 10 users&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;or select with custom columns set. Functions also could be used&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$cols&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt; (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;name&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;email&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$users&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$cols&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;0&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$users&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$user&lt;/span&gt;) { &lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;        &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;print_r&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$user&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    }&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;or select just one row&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$user&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;getOne (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$user&lt;/span&gt;[&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;];&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$stats&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;getOne (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;sum(id), count(*) as cnt&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;total &lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$stats&lt;/span&gt;[&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;cnt&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;]&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users found&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;or select one column or function result&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$count&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; getValue (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;count(*)&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;{&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51);&quot;&gt;$count&lt;/span&gt;} users found&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-delete-query&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#delete-query&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Delete Query&lt;/h3&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;if&lt;/span&gt;(&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;delete(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)) &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;successfully deleted&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-generic-query-method&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#generic-query-method&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Generic Query Method&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;By default rawQuery() will filter out special characters so if you getting problems with it you might try to disable filtering function. In this case make sure that all external variables are passed to the query via bind variables&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// filtering enabled&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$users&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;rawQuery(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51);&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;from&lt;/span&gt; users &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;where&lt;/span&gt; customerId&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt;?&lt;/span&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt; (&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;10&lt;/span&gt;));&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// filtering disabled&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;//$users = $db-&amp;gt;rawQuery('SELECT * from users where id &amp;gt;= ?', Array (10), false);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$users&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$user&lt;/span&gt;) {&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;print_r&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$user&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;More advanced examples:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$params&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt;(&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;admin&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$users&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;rawQuery(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51);&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;SELECT&lt;/span&gt; id, firstName, lastName &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;FROM&lt;/span&gt; users &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;WHERE&lt;/span&gt; id &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; ? &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;AND&lt;/span&gt; login &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; ?&lt;/span&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$params&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;print_r&lt;/span&gt;(&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$users&lt;/span&gt;); &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// contains Array of returned rows&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// will handle any SQL query&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$params&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt;(&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;11&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;10&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$q&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;    SELECT a FROM t1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;        WHERE a = ? AND B = ?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;        ORDER BY a LIMIT ?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;) UNION (&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;    SELECT a FROM t2 &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;        WHERE a = ? AND B = ?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;        ORDER BY a LIMIT ?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;)&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$resutls&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;rawQuery (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$q&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$params&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;print_r&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt;); &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// contains Array of returned rows&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-where-method&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#where-method&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Where Method&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;This method allows you to specify where parameters of the query. WARNING: In order to use column to column comparisons only raw where conditions should be used as column name or functions cant be passed as a bind variable.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Regular == operator with variables:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;login&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;admin&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users WHERE id=1 AND login='admin';&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Regular == operator with column to column comparison:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// WRONG&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;lastLogin&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;createdAt&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// CORRECT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;lastLogin = createdAt&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users WHERE lastLogin = createdAt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&amp;gt;=&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// or $db-&amp;gt;where ('id', Array ('&amp;gt;=' =&amp;gt; 50));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users WHERE id &amp;gt;= 50;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;BETWEEN / NOT BETWEEN:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt; (&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;20&lt;/span&gt;), &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;BETWEEN&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// or $db-&amp;gt;where ('id', Array ('BETWEEN' =&amp;gt; Array(4, 20)));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users WHERE id BETWEEN 4 AND 20&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;IN / NOT IN:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt;(&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;27&lt;/span&gt;, &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;d&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;), &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;IN&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// or $db-&amp;gt;where('id', Array( 'IN' =&amp;gt; Array(1, 5, 27, -1, 'd') ) );&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users WHERE id IN (1, 5, 27, -1, 'd');&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;OR CASE&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;firstName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;John&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;orWhere (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;firstName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;Peter&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users WHERE firstName='John' OR firstName='peter'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;NULL comparison:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;lastName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;NULL&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&amp;lt;=&amp;gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users where lastName &amp;lt;=&amp;gt; NULL&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Also you can use raw where conditions:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;id != companyId&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;DATE(createdAt) = DATE(lastLogin)&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Or raw condition with variables:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;(id = ? or id = ?)&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt;(&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;6&lt;/span&gt;,&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;2&lt;/span&gt;));&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;login&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;mike&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$res&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users WHERE (id = 2 or id = 2) and login='mike';&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Optionally you can use method chaining to call where multiple times without referencing your object over an over:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;1&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;login&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;admin&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-ordering-method&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#ordering-method&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Ordering method&lt;/h3&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;orderBy(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;asc&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;orderBy(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;login&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;Desc&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;orderBy(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;RAND ()&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users ORDER BY id ASC,login DESC, RAND ();&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;order by values example:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;orderBy(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;userGroup&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;ASC&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;array&lt;/span&gt;(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;superuser&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;admin&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;));&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users ORDER BY FIELD (userGroup, 'superuser', 'admin', 'users') ASC;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-grouping-method&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#grouping-method&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Grouping method&lt;/h3&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;groupBy (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;name&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$results&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives: SELECT * FROM users GROUP BY name;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Join table products with table users with LEFT JOIN by tenantID&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-join-method&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#join-method&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;JOIN method&lt;/h3&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;join(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users u&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;p.tenantID=u.tenantID&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;LEFT&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;u.id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;6&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$products&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;products p&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;u.name, p.productName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;print_r&lt;/span&gt; (&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$products&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-properties-sharing&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#properties-sharing&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Properties sharing&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Its is also possible to copy properties&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Simple pagination example:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;agentId&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;10&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;active&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;true&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$customers&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;copy ();&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$res&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$customers&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;customers&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt; (&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;10&lt;/span&gt;));&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// SELECT * FROM customers where agentId = 10 and active = 1 limit 10, 10&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$res&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;getOne (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;customers&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;count(id) as cnt&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;total records found: &lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$res&lt;/span&gt;[&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;cnt&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;];&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// SELECT count(id) FROM users where agentId = 10 and active = 1&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-subqueries&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#subqueries&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Subqueries&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Subquery in selects:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$ids&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;subQuery ();&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$ids&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;qty&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$ids&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;products&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;userId&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$ids&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;in&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$res&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives SELECT * FROM users WHERE id IN (SELECT userId FROM products WHERE qty &amp;gt; 2)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Subquery in inserts:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$userIdQ&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;subQuery ();&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$userIdQ&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;id&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;6&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$userIdQ&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;getOne (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;name&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;),&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$data&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-st&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;Array&lt;/span&gt; (&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;productName&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;test product&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;userId&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$userIdQ&lt;/span&gt;,&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;lastUpdated&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;now()&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$id&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;insert (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;products&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$data&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives INSERT INTO PRODUCTS (productName, userId, lastUpdated) values (&quot;test product&quot;, (SELECT name FROM users WHERE id = 6), NOW());&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-exists--not-exists-condition&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#exists--not-exists-condition&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;EXISTS / NOT EXISTS condition&lt;/h3&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$sub&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;subQuery();&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$sub&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;company&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;testCompany&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$sub&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;userId&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;where (&lt;span class=&quot;pl-c1&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$sub&lt;/span&gt;, &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;exists&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$products&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;products&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;// Gives SELECT * FROM products WHERE EXISTS (select userId from users where company='testCompany')&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-helper-commands&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#helper-commands&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Helper commands&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Reconnect in case mysql connection died&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;ping())&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;connect()&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Obtain an initialized instance of the class from another class&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt; &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;MysqliDb&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;::&lt;/span&gt;getInstance();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Get last executed SQL query. Please note that function returns SQL query only for debugging purposes as its execution most likely will fail due missing quotes around char variables.&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;get(&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;users&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-s3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 134, 179);&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;Last executed query was &lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;getLastQuery();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; position: relative; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;&quot;&gt;&lt;a id=&quot;user-content-transaction-helpers&quot; class=&quot;anchor&quot; href=&quot;https://github.com/joshcam/PHP-MySQLi-Database-Class#transaction-helpers&quot; aria-hidden=&quot;true&quot; style=&quot;box-sizing: border-box; color: rgb(65, 131, 196); position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; line-height: 1.2; background: transparent;&quot;&gt;&lt;/a&gt;Transaction helpers&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;Please keep in mind that transactions are working on innoDB tables. Rollback transaction if insert fails:&lt;/p&gt;&lt;div class=&quot;highlight highlight-php&quot; style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;pre style=&quot;box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);&quot;&gt;&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;startTransaction();&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;insert (&lt;span class=&quot;pl-s1&quot; style=&quot;box-sizing: border-box; color: rgb(223, 80, 0);&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;myTable&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$insertData&lt;/span&gt;)) {&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;//Error while saving, cancel new record&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;rollback();&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;} &lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;else&lt;/span&gt; {&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-c&quot; style=&quot;box-sizing: border-box; color: rgb(150, 152, 150);&quot;&gt;//OK&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;    &lt;span class=&quot;pl-vo&quot; style=&quot;box-sizing: border-box;&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;pl-k&quot; style=&quot;box-sizing: border-box; color: rgb(167, 29, 93);&quot;&gt;-&amp;gt;&lt;/span&gt;commit();&lt;/span&gt;
&lt;span class=&quot;pl-s2&quot; style=&quot;box-sizing: border-box;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev/php</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/231</guid>
      <comments>https://c.tistory.com/231#entry231comment</comments>
      <pubDate>Mon, 16 Feb 2015 08:06:50 +0900</pubDate>
    </item>
    <item>
      <title>파이썬 관련 강좌 올리는 님. django 등</title>
      <link>https://c.tistory.com/230</link>
      <description>&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/user/sentdex&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.youtube.com/user/sentdex&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/230</guid>
      <comments>https://c.tistory.com/230#entry230comment</comments>
      <pubDate>Sat, 14 Feb 2015 23:12:13 +0900</pubDate>
    </item>
    <item>
      <title>이클립스 moonrise 테마</title>
      <link>https://c.tistory.com/229</link>
      <description>&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px;&quot;&gt;&lt;font face=&quot;Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;a href=&quot;https://github.com/guari/eclipse-ui-theme&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://github.com/guari/eclipse-ui-theme&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;a href=&quot;https://camo.githubusercontent.com/9ab3a05f498d7ab0c66a01902014b7e1e7a22c1f/68747470733a2f2f7261772e6769746875622e636f6d2f67756172692f65636c697073652d75692d7468656d652f6d61737465722f636f6d2e6769746875622e65636c6970736575697468656d652e7468656d65732e706c7567696e2f73637265656e73686f742f73637265656e73686f742d7562756e74755f76302e382e322e706e67&quot; target=&quot;_blank&quot; style=&quot;line-height: 25.6000003814697px; box-sizing: border-box; color: rgb(65, 131, 196); background: transparent;&quot;&gt;&lt;img src=&quot;https://camo.githubusercontent.com/9ab3a05f498d7ab0c66a01902014b7e1e7a22c1f/68747470733a2f2f7261772e6769746875622e636f6d2f67756172692f65636c697073652d75692d7468656d652f6d61737465722f636f6d2e6769746875622e65636c6970736575697468656d652e7468656d65732e706c7567696e2f73637265656e73686f742f73637265656e73686f742d7562756e74755f76302e382e322e706e67&quot; alt=&quot;screenshot&quot; data-canonical-src=&quot;https://raw.github.com/guari/eclipse-ui-theme/master/com.github.eclipseuitheme.themes.plugin/screenshot/screenshot-ubuntu_v0.8.2.png&quot; style=&quot;box-sizing: border-box; border: 0px; max-width: 100%;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://camo.githubusercontent.com/496e21a1dd9cf01289560cfdec1c63e37509033b/68747470733a2f2f7261772e6769746875622e636f6d2f67756172692f65636c697073652d75692d7468656d652f6d61737465722f636f6d2e6769746875622e65636c6970736575697468656d652e7468656d65732e706c7567696e2f73637265656e73686f742f73637265656e73686f742d77696e646f77735f76302e382e322e706e67&quot; target=&quot;_blank&quot; style=&quot;line-height: 25.6000003814697px; box-sizing: border-box; color: rgb(65, 131, 196); background: transparent;&quot;&gt;&lt;img src=&quot;https://camo.githubusercontent.com/496e21a1dd9cf01289560cfdec1c63e37509033b/68747470733a2f2f7261772e6769746875622e636f6d2f67756172692f65636c697073652d75692d7468656d652f6d61737465722f636f6d2e6769746875622e65636c6970736575697468656d652e7468656d65732e706c7567696e2f73637265656e73686f742f73637265656e73686f742d77696e646f77735f76302e382e322e706e67&quot; alt=&quot;screenshot&quot; data-canonical-src=&quot;https://raw.github.com/guari/eclipse-ui-theme/master/com.github.eclipseuitheme.themes.plugin/screenshot/screenshot-windows_v0.8.2.png&quot; style=&quot;box-sizing: border-box; border: 0px; max-width: 100%;&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-bottom: 16px; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>dev</category>
      <author>altvirus</author>
      <guid isPermaLink="true">https://c.tistory.com/229</guid>
      <comments>https://c.tistory.com/229#entry229comment</comments>
      <pubDate>Sat, 14 Feb 2015 14:07:39 +0900</pubDate>
    </item>
  </channel>
</rss>