S
S
SilentSokolov2014-07-15 11:30:40
Django
SilentSokolov, 2014-07-15 11:30:40

Haystack: why doesn't autocomplete cut off the excess?

One on one example from the documentation . I only use NgramField.

content_auto = indexes.NgramField(model_attr='content')

At first, everything is fine, if tested on three characters 'old', it will find the following: 'g old fish', 'cuck old ' and ' old er'.
But if you type in 4 characters, then everything starts to work strangely, for example 'old f ': it finds all the same words plus the words content occurrence ' ldf '.
What is needed: so that with 'old f ' only 'g oldf ish' remains.
Tell me where to dig?
On the server:
elascitsearch 1.2
Haystack 2.1.0 (same behavior on the dev branch).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Solovyov, 2014-07-15
@pavel_salauyou

the example in the dock uses the EdgeNrgam tokenizer, and also try using the snowball filter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question