<p>Search replacement in the OSM website by one based on Algolia.</p>

<p>Index can be filled with import.rb script in the root folder of the project.</p>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull https://github.com/bobylito/openstreetmap-website master</pre>
<p>Or view, comment on, or merge it at:</p>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/873'>https://github.com/openstreetmap/openstreetmap-website/pull/873</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Add algolia search library</li>
  <li>Preliminary work on algolia search for cities autocomplete</li>
  <li>Previsualization of the first result in the input</li>
  <li>Focus out on escape</li>
  <li>Refactor into prototype based object to handle state properly</li>
  <li>Implemementation of Up/Down arrows</li>
  <li>Reference result list directly in the component</li>
  <li>Add hover for result selection</li>
  <li>Return key now goes to the selected location</li>
  <li>Fix return behaviour</li>
  <li>Fix nice zoom level for cities (since we don't have a perfect dataset)</li>
  <li>Add click behavior when a element of the list is clicked on</li>
  <li>When focus is on and user had already input some text : display the menu again</li>
  <li>Remove previous OSM search implementation for the sake of demoing</li>
  <li>Fix menu position + cursor for list elements</li>
  <li>Marker generated from the results are highlighted when selected</li>
  <li>Auto zoom bounded by the position of the results</li>
  <li>Fix menu position (when in smaller windows)</li>
  <li>Clean up</li>
  <li>Fix query preview when going through the answers</li>
  <li>Escape now really cancels the search leaving the field filled with the user input</li>
  <li>If return is pressed with entry selected, the first one is selected</li>
  <li>Save user selected result</li>
  <li>Highlight country in the results</li>
  <li>Use popups to display city names with country. Make markers clickable to go back to search.</li>
  <li>Shortcut to search validation</li>
  <li>Implement geoloc (thanks @redox). Fix return behavior (auto select on</li>
  <li>Shadow input should output as the items in the menu</li>
  <li>Add behaviour to the go button : validate the first item in the list</li>
  <li>Import script to algolia</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-0">World_Cities_Location.csv</a>
    (10567)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-1">app/assets/images/marker-grey.png</a>
    (0)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-2">app/assets/javascripts/index.js</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-3">app/assets/javascripts/index/search.js</a>
    (455)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-4">app/assets/stylesheets/algolia/search.css</a>
    (44)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-5">app/views/layouts/_head.html.erb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-6">app/views/layouts/_search.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-7">db/structure.sql</a>
    (18)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-8">import.rb</a>
    (23)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873/files#diff-9">vendor/assets/algolia/algoliaSearch.js</a>
    (7)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/873.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/873.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/873.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/873.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/openstreetmap-website/pull/873">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABWnLZvbTkGwfh2VpMxgM2T9arhzWqYBks5nh-csgaJpZM4DS6Vk.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/openstreetmap/openstreetmap-website/pull/873"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>