Index Fields

Opensolr Index Fields — find answers to your questions

How Text Analysis Works: Stemming, Synonyms & Accent Folding

Every word of your pages and every word a visitor types is cleaned up the same way before the two are compared. That is why a search finds pages that use another form of the same word.

01 · What you get

A search forAlso finds
running shoesrun shoe, Running Shoes
café menucafe menu, CAFE MENU
Wi-Fi setupwifi setup, wi fi setup
iPhone15 caseiphone 15 case
John's blogJohn blog
São Paulo hotelssao paulo hotel

02 · The steps

The fields title, description, text, uri, author and every *_t field go through the same chain:

01

HTML tags left in the text are removed.

02

Accents are folded: é becomes e, ß becomes ss.

03

The text is split into words with Unicode rules, so Chinese, Japanese and Thai split correctly too.

04

Full-width and half-width Asian characters are made the same, and the English possessive 's is removed.

05

A second accent pass catches what the first one missed.

06

Stopwords are dropped: about 170 common English words such as the, and, of, in, for.

07

Words are split at hyphens, case changes and digits, and the joined form is kept too: Wi-Fi gives wi, fi and wifi.

08

Everything goes to lower case.

09

English stemming reduces words to a common stem.

10

Search only: the synonyms of synonyms.txt are added to the words searched.

Every filter, in order and with its Solr class: how text is analysed.

03 · Stemming, for real

WordStem
running, runs, runrun
swimmingswim
organization, organizationsorgan
configured, configuringconfigur
runner, swam, betterunchanged: they do not match run, swim or good

The stemmer is the English Snowball stemmer. Words listed in protwords.txt are never stemmed or split.

04 · Change the word lists

stopwords.txt, synonyms.txt and protwords.txt are edited in the Configuration tab; saving reloads the index. Synonyms apply when people search, so a new synonym works on the next search. Stopwords and protected words apply to indexing too: documents already in the index change only when they are sent again.

05 · Two more fields

The spell field keeps words almost as they are, for Did you mean. The tags and title_tags fields keep every beginning of a word, for autocomplete. All the fields: schema reference.