title: sunspot how query specific field
body: <p>Reading through Sunspot documentation I am trying to find how I can query <strong>autocomplete fields</strong>.</p>
  
  <p><strong>I create them like here</strong> <a href="https://github.com/haitham/sunspot_autocomplete" rel="nofollow noreferrer">https://github.com/haitham/sunspot_autocomplete</a></p>
  
  <p>Here is config solr/conf/schema.xml </p>
  
  <pre><code>&lt;types&gt;
    .......
    &lt;fieldType name="autocomplete" class="solr.TextField" positionIncrementGap="100"&gt;
      &lt;analyzer type="index"&gt;
        &lt;tokenizer class="solr.LetterTokenizerFactory"/&gt;
        &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
        &lt;filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="25" /&gt;
      &lt;/analyzer&gt;
      &lt;analyzer type="query"&gt;
        &lt;tokenizer class="solr.KeywordTokenizerFactory"/&gt;
        &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
      &lt;/analyzer&gt;
    &lt;/fieldType&gt;
    &lt;fieldType name="autosuggest" class="solr.TextField" positionIncrementGap="100"&gt;
      &lt;analyzer type="index"&gt;
        &lt;tokenizer class="solr.KeywordTokenizerFactory"/&gt;
        &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
        &lt;filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="25" /&gt;
      &lt;/analyzer&gt;
      &lt;analyzer type="query"&gt;
        &lt;tokenizer class="solr.LetterTokenizerFactory"/&gt;
        &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
      &lt;/analyzer&gt;
    &lt;/fieldType&gt;
    .....
  &lt;/types&gt;
  &lt;fields&gt;
    ....
    &lt;dynamicField name="*_ac" type="autocomplete" indexed="true"  stored="true"/&gt;
    &lt;dynamicField name="*_as" type="autosuggest" indexed="true"  stored="true"/&gt;
    ....
  &lt;/fields&gt;
  </code></pre>
  
  <p>I have model with searchable fields:</p>
  
  <pre><code>class Post &lt; ActiveRecord::Base
    attr_accessible :text, :user_id
  
    has_one :user
  
    searchable do
      text :text
      integer :user_id, :references =&gt; User
      autocomplete :post_text, :using =&gt; :text
    end
  end
  </code></pre>
  
  <p>When I try to search against an autocomplete field like so:</p>
  
  <pre><code>Sunspot.search(Post) { keywords('ra', :fields =&gt; :'autocomplete') }
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Sunspot::UnrecognizedFieldError: No text field configured for Post with name 'autocomplete'
  </code></pre>
  
  <p>What I'm doing wrong?</p>
  
  <p><strong>I shared the application on github: <a href="https://github.com/pironim/my_sunspot_app.git" rel="nofollow noreferrer">https://github.com/pironim/my_sunspot_app.git</a></strong></p>