1

So we are using Django-haystack with the Elasticsearch backend to index a bunch of data for searching. It is very fast and is working great for the most part, but I notice something that I want that seems to be absent. For example, consider the search query "cellar door". I would want a query that is slightly off, like a misspelling, e.g. "cellar dor" or "celar door" to match results for "cellar door". If I try queries like this with our current setup it returns 0 results. I tried using an EdgeNgramField in the search index on the field we wanted to index, but this seems to have absolutely no effect.

Thanks.

Lucifer N.
  • 966
  • 3
  • 15
  • 34
  • you should use Fuzzy query, find example here http://stackoverflow.com/questions/18000714/how-can-i-do-a-fuzzy-search-using-django-haystack-and-the-elasticsearch-backend – Alex Jul 01 '14 at 15:32

1 Answers1

-1

Use suggest to perform spell check.

curl -XPOST 'localhost:9200/index/_search?search_type=count' -d '{

{
   "suggest": {
      "body": {
         "text": "celar door",
         "term": {
            "field": "summary",
            "analyzer": "simple"
         }
      }
   }
}'
Siddardha Budige
  • 1,005
  • 1
  • 8
  • 12