I am using django 1.5 along with haystack 2.1.0.
While using auto-query on one of the models I found the following behavior.
test_search = "charles ken"
SearchQuerySet().models(Foo, FooSome, FooGone).auto_query(test_search)
The above query gives multiple results.
test_search = "charles k"
SearchQuerySet().models(Foo, FooSome, FooGone).auto_query(test_search)
The above query gives no results. What am I doing wrong ?
Edit :
The field in concern is edge_ngram
<fieldType name="edge_ngram" class="solr.TextField" positionIncrementGap="1">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
</analyzer>
</fieldType>
You need to change the minGramSize here to 1
But I would recommend to have minGramSize=2 or 3 as it would avoid to many indexes.