[Xapian-discuss] Index indexed words

Tom tom at lemurconsulting.com
Tue Jan 19 09:08:35 GMT 2010


2010/1/18 double <ninive at gmx.at>:
> Hello,
>
> We would like to create Google or Firefox like "search hints".
> If someone types "abc", the search system should name
> some possible hints.
>
> I think, Firefox does it by indexing 3-characters of the domain
> name. If you enter parts, you get some hints.

Hi Marcus,

I've done this by using an auxiliary database of suggestions, indexing
them with partial terms, e.g.

"Sigourney Weaver" -> "s", "si", "sig", ... "sigourney wea", ...

Then you can just create a single term query out of the user's partial
input. A simple refinement to this would be to use spelling correction
in case the user mistypes.

There's also FLAG_PARTIAL in Xapian's QueryParser
(http://shrunk.net/83d4d091) which is supposed to do much the same
thing and doesn't require creating a special database, but I haven't
tried it.

regards,
Tom



More information about the Xapian-discuss mailing list