title: How to get Suggestions in Solr 5.3.0
body: <p>I am trying to implement auto complete feature using Solr 5.3.0</p>
  
  <p>solrconfig.xml looks like this</p>
  
  <pre><code>&lt;searchComponent name="suggest" class="solr.SuggestComponent"&gt;
    &lt;lst name="suggester"&gt;
      &lt;str name="name"&gt;default&lt;/str&gt;
      &lt;str name="lookupImpl"&gt;FuzzyLookupFactory&lt;/str&gt;
      &lt;str name="dictionaryImpl"&gt;DocumentDictionaryFactory&lt;/str&gt;
      &lt;str name="field"&gt;suggest_ngram&lt;/str&gt;
      &lt;str name="weightField"&gt;price&lt;/str&gt;
      &lt;str name="suggestAnalyzerFieldType"&gt;text_suggest_ngram&lt;/str&gt;
      &lt;str name="buildOnStartup"&gt;true&lt;/str&gt;
    &lt;/lst&gt;
  &lt;/searchComponent&gt;
  
  &lt;requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" &gt;
  &lt;lst name="defaults"&gt;
    &lt;str name="suggest"&gt;true&lt;/str&gt;
    &lt;str name="suggest.count"&gt;10&lt;/str&gt;
  &lt;/lst&gt;
  &lt;arr name="components"&gt;
    &lt;str&gt;suggest&lt;/str&gt;
  &lt;/arr&gt;
  </code></pre>
  
  <p></p>
  
  <p>managed-schema looks like this:</p>
  
  <pre><code>&lt;fieldType name="text_suggest_ngram" class="solr.TextField" positionIncrementGap="100"&gt;
  &lt;analyzer type="index"&gt;
  &lt;tokenizer class="solr.StandardTokenizerFactory"/&gt;
    &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
    &lt;filter class="solr.EdgeNGramFilterFactory" maxGramSize="10" minGramSize="2" /&gt;
  &lt;/analyzer&gt;
  &lt;analyzer type="query"&gt;
    &lt;tokenizer class="solr.StandardTokenizerFactory"/&gt;
    &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
  &lt;/analyzer&gt;
  &lt;/fieldType&gt;
  
  
  &lt;field name="suggest_ngram" type="text_suggest_ngram" indexed="true" stored="false"/&gt;
  &lt;field name="name" type="string" multiValued="false" indexed="true" stored="true"/&gt;
  &lt;field name="price" type="tlong" multiValued="false" indexed="true" stored="true"/&gt;
  &lt;copyField source="name" dest="suggest_ngram"/&gt;
  </code></pre>
  
  <p>Now when I use the analyzer from the admin panel of Solr, I can see the indexed ngrams. And it successfully points out the match.</p>
  
  <p>However when I use the query:</p>
  
  <pre><code>http://localhost:8983/solr/products/suggest?suggest=true&amp;suggest.build=true&amp;wt=json&amp;suggest.q=Jind
  </code></pre>
  
  <p>I get 0 suggestions.
  The response is here:
  <a href="https://api.myjson.com/bins/47r3i" rel="nofollow">https://api.myjson.com/bins/47r3i</a></p>
  
  <p>There exists a value "Jindal Panther" for the name key in one of the docs.</p>
  
  <p>Moreover, I have found that if I create a dummy copyfield "suggest" with type as "String", with source as "name", any suggestion that works fine on "name" will not work on "suggest". Can this be any misconfiguration of copyfield to enable suggestions?</p>
  
  <p>Any help would be appreciated.
  Thanks in advance.</p>
  
  <p>EDIT:
  Got the solution. See the accepted answer and its comments below.
  There is a blog that I encountered that beautifully explains Suggesters. It is definitely worth reading for a newbie to Solr Search.</p>
  
  <p><a href="https://lucidworks.com/blog/2015/03/04/solr-suggester/" rel="nofollow">https://lucidworks.com/blog/2015/03/04/solr-suggester/</a></p>