title: Use mongoosastic for an autocomplete
body: <p>I'm trying to create an autocomplete using mongoosastic and Elastic Search, and so far, I have been able to create it using sense but I'm having trouble porting it to mongoosastic. </p>
  
  <p>I followed <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html">this</a> tutorial from ElasticSearch docs, and I was able to achieve what I wanted using "sense" with a mapping that looks like this:</p>
  
  <pre><code>PUT storys/story/_mapping
  {
      "story" : { 
          "properties": {
              "description": {
                  "type": "string"
              },
              "title": {
                  "type" : "completion",
                  "index_analyzer": "simple",
                  "search_analyzer": "simple"
              }
          }  
      }
  }
  </code></pre>
  
  <p>and a query like this:</p>
  
  <pre><code>GET storys/_suggest
  {
      "story-suggest": {
          "text": "bow",
          "completion": {
              "field": "title"
          }
      }
  }
  </code></pre>
  
  <p>However, I'm having trouble porting this to mongoosastic. I tried the following approach:</p>
  
  <pre><code>    var StorySchema = new Schema({
          title:{
              type: String, es_type:'completion', es_index_analyzer: 'simple', es_search_analyzer: 'simple', es_payloads: true
          },
          description: { 
              type: String
          }
      });
  
  StorySchema.plugin(mongoosastic);
  </code></pre>
  
  <p>And when querying from the server controller:</p>
  
  <pre><code>Story.search({ 
      query: {
          "match": { title : req.query.q }
      },
      suggest: {
              "my-title-suggestions-1" :{
                  text: req.query.q,
                  completion: {
                      field: 'title'
                  }
              }
          }
  });
  </code></pre>
  
  <p>I understand that when I use "sense", I'm using the _suggest endpoint, and that's why the "story-suggest" query works. However, when using mongoosastic, I'm limited to use the .search({}) for querying which acts like _search I suppose. However, I cannot seem to find a way to accomplish the _suggest behavior I'm seeking for an autocomplete, and I keep getting parsing errors in ElasticSearch when I try to do a query with a suggest.</p>
  
  <p>Is there a way to accomplish what I'm trying to do either with mongoosastic or elastic search?</p>
  
  <p>I have tried doing this using "sense" but even though I get the suggestions for "autocomplete" I also get a bunch of SearchParseExceptions: </p>
  
  <pre><code>GET _search
  {
      "query": {
         "match": { title : "bow" }
      },
      "suggest": {
          "story-suggest": {
              "text": "bow",
              "completion": {
                  "field": "title"
              }
          }
      }
  }
  </code></pre>