ตัววิเคราะห์ ตัวแบ่งคำ และดัชนีแบบกลับด้าน
เรียนรู้ว่า Elasticsearch เปลี่ยนข้อความให้เป็นโทเค็นที่ค้นหาได้ด้วยตัววิเคราะห์อย่างไร และจัดเก็บโทเค็นเหล่านั้นในดัชนีแบบกลับด้านอย่างไร
ตัววิเคราะห์ ตัวแบ่งคำ และดัชนีแบบกลับด้าน เป็นบทเรียน Elasticsearch & Full Text Search Systems ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Elasticsearch & Full Text Search Systems และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Elasticsearch & Full Text Search Systems มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
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.
เรียนรู้ Elasticsearch & Full Text Search Systems ด้วย AI tutor — ฟรี
เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป
- คอร์ส
- 12
- บทเรียน
- 48
คำถามที่พบบ่อย
บทเรียน “ตัววิเคราะห์ ตัวแบ่งคำ และดัชนีแบบกลับด้าน” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “ตัววิเคราะห์ ตัวแบ่งคำ และดัชนีแบบกลับด้าน” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Elasticsearch & Full Text Search Systems ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Elasticsearch & Full Text Search Systems มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “ตัววิเคราะห์ ตัวแบ่งคำ และดัชนีแบบกลับด้าน”
เรียนรู้ว่า Elasticsearch เปลี่ยนข้อความให้เป็นโทเค็นที่ค้นหาได้ด้วยตัววิเคราะห์อย่างไร และจัดเก็บโทเค็นเหล่านั้นในดัชนีแบบกลับด้านอย่างไร คุณปฏิบัติ Elasticsearch & Full Text Search Systems ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Elasticsearch & Full Text Search Systems หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Elasticsearch & Full Text Search Systems บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “ตัววิเคราะห์ ตัวแบ่งคำ และดัชนีแบบกลับด้าน” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Elasticsearch & Full Text Search Systems นี้ได้ไหม
ได้ บทเรียน Elasticsearch & Full Text Search Systems ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- การค้นหาข้อความแบบเต็มคืออะไร
- แนวคิดหลักของ Elasticsearch
- การตั้งค่าคลัสเตอร์แรกของคุณ
- ตัววิเคราะห์ ตัวแบ่งคำ และดัชนีแบบกลับด้าน