# Search

Every published library has a search page at `/library-slug/search`, reached from the search box on each page. It searches the whole library, in every language.

## What it finds

- Words in page titles and text. Title matches rank higher.
- Parts of words, too: codes, product names and words a language's rules would split differently.
- One result per page: a match in the reader's language comes first; a match only in another language is shown with that language's name.

Hidden pages, pages in the trash and unpublished libraries never appear. A search needs at least two characters.

## Stemming: which languages get it

For most languages, search understands different forms of a word: "invoices" finds "invoice", "facturen" finds "factuur". That is called stemming. It depends on the language of each page.

The database we use has no stemming rules for nine of the languages we support. For those, search finds exact words (and parts of words), but not other forms of the same word. Write the words your readers will look for, or add them to the page.

Regional variants follow their language: `en-gb` searches like `en`, `pt-br` like `pt`.

### Stemmed search

| Code | Language |
| --- | --- |
| `en` | English |
| `nl` | Dutch |
| `fr` | French |
| `de` | German |
| `es` | Spanish |
| `pt` | Portuguese |
| `it` | Italian |
| `sv` | Swedish |
| `nb` | Norwegian Bokmål |
| `da` | Danish |
| `fi` | Finnish |
| `ga` | Irish |
| `hu` | Hungarian |
| `ro` | Romanian |
| `el` | Greek |
| `sr` | Serbian |
| `et` | Estonian |
| `lt` | Lithuanian |
| `ru` | Russian |
| `tr` | Turkish |
| `ca` | Catalan |

### Exact words only

| Code | Language |
| --- | --- |
| `is` | Icelandic |
| `pl` | Polish |
| `cs` | Czech |
| `sk` | Slovak |
| `bg` | Bulgarian |
| `hr` | Croatian |
| `sl` | Slovenian |
| `lv` | Latvian |
| `uk` | Ukrainian |

## What we keep

Each search is recorded with its words, the library, the language and the number of results, and nothing about who searched. Searches are deleted after 90 days.
