title: Elastic search or Trie for search/autocomplete?
body: <p><strong>My understanding how autocomplete/search for text/item works at high level in any scalable product like Amazon eCommerce/Google at high level was :-</strong></p>
  
  <p>Elastic Search(ES) based approach</p>
  
  <ol>
  <li><p>Documents are stored in DB . Once persisted given to Elastic search, It creates the index and store the index/document(based on tokenizer) in memory or disk based 
  configuration.</p></li>
  <li><p>Once user types say 3 characters, it search all index under ES(Can be configured to index even ngram) , Rank them based on weightage and return to user</p></li>
  </ol>
  
  <p>But after reading couple of resources on google like <a href="https://www.youtube.com/watch?v=us0qySiUsGU&amp;feature=youtu.be" rel="noreferrer">Trie based search</a></p>
  
  <p>Looks some of the scalable product also uses <code>Trie</code> data stucture to do the prefix based search. </p>
  
  <p>My question Is Can trie based approach  be good alternative to ES or ES internally uses <code>Trie</code> or am i missing completely here ?</p>