title: Django: Auto suggest using Elasticsearch DSL
body: <p>I am using elasticsearch-dsl to index data in elasticsearch index. I am am using following class to create elasticsearch document:</p>
  
  <pre><code>class BooksDoc(Document):
  
      title = Text(
          analyzer=my_analyzer
      )
      author = Text(
          analyzer=my_analyzer
      )
      publisher = Text(
          analyzer=my_analyzer
      )
      image_url = Text(analyzer=my_analyzer)
      price = Text(analyzer=my_analyzer)
      category =Text(analyzer=my_analyzer)
      published = Boolean()
      upload_date = Text()
      class Index:
          name = 'books'
  </code></pre>
  
  <p>Here is my analyzer:</p>
  
  <pre><code>my_analyzer = analyzer('my_analyzer',
      tokenizer=tokenizer('trigram', 'edge_ngram', min_gram=1, max_gram=20),
      filter=['lowercase']
  )
  </code></pre>
  
  <p>I am using following function to index document:</p>
  
  <pre><code>    def indexing(self):
      doc = BooksDoc(
          meta={'id': self.id},
          title=self.book_title,
          author=self.book_author,
          publisher=self.book_publisher,
          image_url=self.front_image,
          price=self.book_price,
          catagory=__catagory,
          published=self.isPublished,
          upload_date=self.dateadded
      )
      try:
          doc.save()
          return doc.to_dict(include_meta=True)
      except:
          print(traceback.format_exc())
          return None
  </code></pre>
  
  <p>I want to implement search such that when user enters a search string i can query elasticsearch and fetch all the records where i find a match. For example, if user enters "Boo" then all the records containing string "Boo" should be returned.Right now search works fine when string matches exactly in elasticsearch but i also want to fetch record if there is a partial match. How can i do this?</p>