Support for Elasticsearch Completion Suggester

44 views
Skip to first unread message

Info Cascade

unread,
Feb 12, 2017, 1:57:01 AM2/12/17
to django-haystack
Hi,

I'm using Haystack 2.5.0 with Elasticsearch 1.6.

I need to improve typeahead search results for a query of world cities. 

The desired behavior is that the user types in "San Fran" and the search
returns a list of San Fran* that gets more specific the more characters
they type.  (There are a lot of San Franciscos, but filtering/ordering
is a slightly different issue.)

I've been using the autocomplete feature with EdgeNGram, NGram and simply
filtering the query set, but not quite getting the behavior I want.

In the first case, it seems like it only searches on full token matches,
so "San" returns a list of results, "San Fran" does not, and "San
Francisco" does.

With NGram matches can start in the center of the city name, which is
not desired.  The search needs to be anchored at the beginning (i.e. if
they are looking for San Francisco, they can't type "Francisco" and
expect to find it).


I think what I need is the Elasticsearch Completion Suggester.  Does
that sound like the right direction?

Does Haystack provide support for that capability?

Even if I had to enter a raw search query, I'm not sure how I would set up the indexing correctly.

I'm not an expert with Haystack or Elasticsearch by any means, so any
tips are appreciated.

Thanks.
Reply all
Reply to author
Forward
0 new messages