Has anyone ever used Xapian for implementing an Auto-Complete/Auto-Suggest feature? i.e. providing possible set of suggestions as the user types a.k.a. Google's Auto-Suggest.
I have about 2 million phrases for which I am considering using Xapian as the search framework. As I understand, this framework was not build for this kind of feature. So I would like to know somethings before diving into this -
- If someone has taken a stab at this then what are the problems one encountered?
- Is this the right framework to build something like this?
- If I am taking a totally wrong approach or wrong framework, t开发者_如何转开发hen please suggest alternatives.
I'm interested to know why you think xapian might not be up for this?
Some things to check out:
- The mailing list archives
- FLAG_PARTIAL
You may have to spend some time tuning your look ups so that they only start to autocomplete after n
letters. Doing a partial search for a*
(basically what FLAG_PARTIAL
will do) will hammer your database.
Also, you'll only want to return a few results, and you'll want to think about how stemming etc will work.
I can't give you an exact way of making it work, but it is possible with some tuning. If you know how xapian works, you should be able to set it up in an efficient way. For example, you might consider creating a special index just for autocomplete, where you have more stop words than you might normally have, fewer values and terms, etc.
精彩评论