Artykuły

SphinxSearch finding by partial and inflected words

· 1 min czytaniasoftdevel

To enable searching with partial words eg. returning records that contain ‘linux’, when user queries only for “lin”, you need to add following options to the sphinx.conf:

index name_idx
{
	...
    min_infix_len = 3
    expand_keywords = 1
}

and just run the indexer.

Now it is possible to search for articles using only part of the words, eg. lin fedo will return posts associated with (among others): linux and fedora.

Inflection of words

To find texts with words in different forms then the ones used in query you need to use lemmatizer or stemmer dedicated for the language:

index name_idx
{
	...
	morphology      = stem_en
}

Results:

References

Wszystkie artykuły

Zobacz też

softdevel

Notuj swobodnie, niech AI zadba o resztę

Od zawsze, im więcej notowałem, tym mniej użyteczny stawał się mój notes, czy to papierowy, czy elektroniczny.

linuxsoftdevelEN

Linux server administration: a practical cheatsheet

Security checks, certificates, scheduled jobs, disks and backups, network diagnostics and basic system configuration — commands I use on Linux servers.

ovhlinuxsoftdevelEN

OVH Public Cloud: moving instances, adding disks and swapping the gateway

Moving virtual servers with the OpenStack client, attaching a new block storage disk, and replacing the private network gateway when the public IP is blacklisted.