Analyzer, tokenizer e indice invertito
Impari come Elasticsearch trasformi il testo in token ricercabili usando gli analyzer e li memorizzi in un indice invertito.
Analyzer, tokenizer e indice invertito è una lezione Elasticsearch & Full Text Search Systems gratuita su CoddyKit. Questa è la lezione 4 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Elasticsearch & Full Text Search Systems, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Elasticsearch & Full Text Search Systems include 4 lezioni in totale.
Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.
From Text to Tokens
Before text is searchable, an analyzer breaks it into tokens and stores them in an inverted index. That's the first step of every search.
The Inverted Index
An inverted index maps each token to the documents that contain it — like a book's index — making full-text lookups extremely fast.
Anatomy of an Analyzer
An analyzer runs three stages in order: character filters clean raw text, a tokenizer splits it into tokens, and token filters reshape them.
The Standard Analyzer
The default standard analyzer splits on word boundaries and lowercases, so Quick Brown Fox! becomes quick, brown, fox.
Testing with _analyze
The _analyze API shows exactly which tokens an analyzer produces from your text — run it to see the output.
POST /_analyze
{
"analyzer": "standard",
"text": "The Quick Brown Foxes"
}Stemming
A stemming filter reduces words to their root, so running, runs, and ran all map to run — and searching one finds the others.
Stop Words
A stop filter removes low-value words like the, a, and is, shrinking the index and improving relevance.
Custom Analyzer
Define a custom analyzer in index settings by combining a tokenizer with filters — the code wires up lowercase, stop words, and stemming.
PUT /articles
{
"settings": { "analysis": { "analyzer": {
"my_english": {
"tokenizer": "standard",
"filter": ["lowercase", "english_stop", "english_stemmer"]
}}}}
}text vs keyword
A text field is analyzed for full-text search; a keyword field stays one exact token for filtering, sorting, and aggregations.
Index vs Search Time
Analysis runs at index time when storing a document and again at search time on the query — usually the same analyzer, so tokens match.
Multi-field Mapping
A handy trick: map a string as text for search and add a .keyword sub-field for exact matches and aggregations at once.
"title": { "type": "text",
"fields": { "raw": { "type": "keyword" } } }Quick Check
Why are text and keyword fields treated differently?
Recap
Recap: analyzers (filters, tokenizer, filters) build the inverted index, stemming and stop words refine it, and text vs keyword shapes how fields behave.
Impara Elasticsearch & Full Text Search Systems con un tutor IA — gratis
Scrivi ed esegui vero codice nel tuo browser, ricevi aiuto istantaneo da un tutor IA disponibile 24/7, e riprendi da dove hai lasciato sul web o nell'app.
- Corsi
- 12
- Lezioni
- 48
Domande Frequenti
La lezione «Analyzer, tokenizer e indice invertito» è gratuita?
Sì — il testo completo di «Analyzer, tokenizer e indice invertito» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Elasticsearch & Full Text Search Systems, passa a CoddyKit PRO. Il corso Elasticsearch & Full Text Search Systems include 4 lezioni in totale.
Cosa imparerò in «Analyzer, tokenizer e indice invertito»?
Impari come Elasticsearch trasformi il testo in token ricercabili usando gli analyzer e li memorizzi in un indice invertito. Eserciti Elasticsearch & Full Text Search Systems con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.
Ho bisogno di esperienza per iniziare Elasticsearch & Full Text Search Systems?
Non è richiesta alcuna esperienza precedente. Elasticsearch & Full Text Search Systems su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 4 di 4.
Quanto tempo richiede la lezione «Analyzer, tokenizer e indice invertito»?
La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.
Posso scrivere ed eseguire codice in questa lezione Elasticsearch & Full Text Search Systems?
Sì. Ogni lezione Elasticsearch & Full Text Search Systems include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.
Tutte le lezioni di questo corso
- Che cos'è la ricerca full-text?
- Concetti fondamentali di Elasticsearch
- Configurazione del primo cluster
- Analyzer, tokenizer e indice invertito