toastdriven/django-haystack — pull request #696 by ComoWhat (2012-11-30 21:51:33+00:00)
Title: ElasticSearch Mapping, term_vector and EdgeNgram Tokenizer

I've made a few changes that fixed a few issues that I was facing.

There was an issue where the mappings of my search fields were not being added. This made EdgeNgram and Ngram useless.

I posted the error on stack overflow and got an answer to fix the bug:
http://stackoverflow.com/questions/13593492/partial-word-search-with-haystack-elasticsearch

I also created a ticket for it here:
https://github.com/toastdriven/django-haystack/issues/695

I also faced another issue when searching for partial numbers in an EdgeNGram field. I was using this particular field to store product sku's and because the lowercase tokenizer does not tokenize numbers correctly, I had to switch it to a standard tokenizer and add the lowercase filter to the list of filters. I feel like this is a better default since it allows for partial search of words and numbers and search for products is becoming pretty standard.

Lastly, I couldn't find a way to toggle whether or not I wanted a term_vector to be built on my search fields of type string. I added a term_vector boolean that you can pass in when you instantiate a new search field. This allows me to keep an analyzer on that field without making my index larger with a feature I'm not using.

Regards,
Aldo