toastdriven/django-haystack — pull request #1056 by phill-tornroth (2014-08-15 16:03:02+00:00)
Title: Autocompleting numbers in Elasticsearch isn't working

The "lowercase" tokenizer was being used for ngram/edge-ngram fields. Apparently it tokenizes numbers into individual digits, which are then ignored because the min-ngram size is 2. This means autocompletion of numbers just won't work at all. This commit contains a test which proves the bug and the fix. Essentially this is now tokenizing using "standard" and adds the lowercase operation as a filter.

Solution and understanding of the problem robbed from http://stackoverflow.com/questions/13636419/elasticsearch-edgengrams-and-numbers