분석기, 토크나이저, 필터
문자 필터, 토크나이저, 토큰 필터를 비롯한 텍스트 분석 구성 요소와 각각의 역할을 심층적으로 알아봅니다.
분석기, 토크나이저, 필터은(는) CoddyKit의 무료 Elasticsearch & Full Text Search Systems 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Elasticsearch & Full Text Search Systems 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Unlocking Search with Text Analysis
When you search, you expect relevant results, even with typos or different word forms. This magic happens through text analysis!
Text analysis is how Elasticsearch processes raw text into a format suitable for searching. It breaks down and transforms your content to make it highly searchable and improve relevancy.
The Analyzer: Your Text Processor
At the heart of text analysis is the analyzer. Think of an analyzer as a complete pipeline, a series of steps that takes raw text and prepares it for indexing and searching.
Every analyzer consists of up to three main components:
- Character Filters: Clean up the raw text.
- Tokenizer: Breaks text into individual 'tokens' (words).
- Token Filters: Refine and modify these tokens.
Character Filters: Cleaning Up Text
Character filters are the first step in the analysis pipeline. They work on the raw text string before it's broken into tokens.
Their job is to clean up or transform the text. Common uses include:
- Removing HTML tags (e.g.,
<b>hello</b>becomeshello). - Replacing characters (e.g.,
&toand). - Mapping specific characters to others.
Char Filter Demo: HTML Strip
Let's use the _analyze API to see an html_strip character filter remove HTML tags. Notice how the text is still a single string at this stage.
POST _analyze
{
"char_filter": ["html_strip"],
"text": "<b>Hello</b> <i>world</i>!"
}The Tokenizer: Breaking into Words
After character filters, the tokenizer takes over. Its primary role is to break the cleaned text into individual 'tokens' or words. These tokens are what eventually get indexed and searched.
Different tokenizers exist for various needs:
- Standard Tokenizer: Default, good for most languages, handles punctuation.
- Whitespace Tokenizer: Splits text only by whitespace.
- Keyword Tokenizer: Treats the entire input as a single, unchangeable token (useful for IDs or specific codes).
Tokenizer Demo: Standard Tokenizer
The standard tokenizer is widely used. It intelligently splits text, removes most punctuation, and lowercases words by default (though lowercasing is technically a token filter often applied with it).
POST _analyze
{
"tokenizer": "standard",
"text": "Quick brown fox!"
}Token Filters: Refining Tokens
The final step is token filters. These filters take the tokens produced by the tokenizer and modify them. They can add, remove, or change tokens, significantly impacting search relevancy.
Examples of token filters:
- Lowercase Filter: Converts all tokens to lowercase.
- Stopword Filter: Removes common, less meaningful words (e.g., 'the', 'is', 'a').
- Synonym Filter: Replaces words with their synonyms.
- Stemmer Filter: Reduces words to their root form (e.g., 'running' to 'run').
Token Filter Demo: Lowercase & Stop
Let's see how lowercase and stop filters work. We'll use the standard tokenizer first, then apply these filters.
POST _analyze
{
"tokenizer": "standard",
"filter": ["lowercase", "stop"],
"text": "The Quick brown fox is fast."
}The Full Analysis Pipeline
Here's how all the components work together in sequence:
- Raw Text enters the analyzer.
- It passes through Character Filters (cleaning).
- The output goes to the Tokenizer (breaking into tokens).
- Finally, the tokens are processed by Token Filters (refinement).
- The result is a set of Searchable Terms.
This pipeline ensures consistent and effective text processing for your search data.
Check Your Understanding
Consider the text: <p>Learn Elasticsearch</p>
If you want to remove the HTML tags <p> and <b> before the text is split into words, which component of the analyzer pipeline would you use?
Recap: Analysis Components
Great job! You've successfully explored the building blocks of Elasticsearch's text analysis:
- Analyzers: The complete text processing pipeline.
- Character Filters: Pre-process raw text (e.g., remove HTML, replace characters).
- Tokenizers: Break text into individual tokens (words).
- Token Filters: Refine and modify tokens (e.g., lowercase, remove stop words, stem).
Understanding these components is crucial for building powerful and relevant search experiences!
자주 묻는 질문
“분석기, 토크나이저, 필터” 강의는 무료인가요?
네 — “분석기, 토크나이저, 필터” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Elasticsearch & Full Text Search Systems 강의 전체를 잠금 해제할 수 있습니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.
“분석기, 토크나이저, 필터”에서 뭘 배우나요?
문자 필터, 토크나이저, 토큰 필터를 비롯한 텍스트 분석 구성 요소와 각각의 역할을 심층적으로 알아봅니다. 브라우저에서 직접 실행하는 실습 코드로 Elasticsearch & Full Text Search Systems을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Elasticsearch & Full Text Search Systems을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Elasticsearch & Full Text Search Systems은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 1번째 강의입니다.
“분석기, 토크나이저, 필터” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Elasticsearch & Full Text Search Systems 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Elasticsearch & Full Text Search Systems 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 분석기, 토크나이저, 필터
- 텍스트 분석기 사용자 지정
- 부스트와 관련성 점수
- 동의어 및 어간 추출