개요
MongoDB Search 분석기 문자 시퀀스를 변환, 필터하다 및 그룹 일련의 작업을 수행하여 인덱싱할 문서 설정하다 를 준비합니다. Atlas UI 에서 특정 인덱싱 요구 사항에 맞게 사용자 지정 분석기 정의할 수 있습니다.
A custom MongoDB Search analyzer is made up of a tokenizer, an optional list of character filters, and an optional list of token filters. When MongoDB Search analyzes text with a custom analyzer, the text passes through the character filters first, then the tokenizer, and then the token filters.
구문
사용자 지정 분석기의 구문은 다음과 같습니다.
"analyzers": [ { "name": "<name>", "charFilters": [ <list-of-character-filters> ], "tokenizer": { "type": "<tokenizer-type>" }, "tokenFilters": [ <list-of-token-filters> ] } ]
속성
사용자 지정 분석기에는 다음과 같은 속성이 있습니다.
속성 | 유형 | 설명 | 필수 사항입니다. |
|---|---|---|---|
| 문자열 | 사용자 지정 분석기의 이름입니다. 이름은 인덱스 내에서 고유해야 하며 다음 문자열로 시작할 수 없습니다.
| 네 |
| 객체 목록 | no | |
| 객체 | 네 | |
| 객체 목록 | 토큰 필터가 0개 이상 포함된 배열입니다. 토큰 필터는 다음과 같은 작업을 수행합니다.
자세히 알아보려면 토큰 필터를 참조하세요. | no |
내장형 사용자 지정 분석기 템플릿
The Atlas UI Visual Editor includes the option to choose between the following common-use templates to help you get started with building your custom analyzer:
Email Parser - Use this to tokenize email addresses up to 200 characters using the uaxUrlEmail tokenizer. For example, you can apply this analyzer on the
page_updated_by.emailfield in the Example Collection.전화번호 - regexCaptureGroup 토크나이저를 사용하여 미국 형식의 전화번호에서 단일 토큰을 생성합니다. 예를 들어 예시 컬렉션의
page_updated_by.phone필드에 이 분석기를 적용할 수 있습니다.대시로 구분된 ID - regexSplit 토크나이저를 사용하여 하이픈으로 구분된 텍스트에서 토큰을 만드는 데 사용합니다. 예를 들어 예시 컬렉션의
message필드에 이 분석기를 적용할 수 있습니다.
이러한 내장 사용자 지정 분석기를 사용하거나 MongoDB Search Visual Editor 또는 JSON 편집기를 사용하여 사용자 지정 분석기를 만들 수 있습니다.
컬렉션 예시
문자 필터, 토크나이저 및 토큰 필터 페이지에는 문자 필터, 토크나이저 및 토큰 필터에 대한 샘플 인덱스 정의와 쿼리 예시가 포함되어 있습니다. 이 예에서는 다음 문서가 포함된 minutes 샘플 컬렉션을 사용합니다.
{ "_id": 1, "page_updated_by": { "last_name": "AUERBACH", "first_name": "Siân", "email": "auerbach@example.com", "phone": "(123)-456-7890" }, "title": "The team's weekly meeting", "message": "try to siGn-In", "text": { "en_US": "<head> This page deals with department meetings.</head>", "sv_FI": "Den här sidan behandlar avdelningsmöten", "fr_CA": "Cette page traite des réunions de département" } }
{ "_id": 2, "page_updated_by": { "last_name": "OHRBACH", "first_name": "Noël", "email": "ohrbach@example.com", "phone": "(123) 456 0987" }, "title": "The check-in with sales team", "message": "do not forget to SIGN-IN. See ① for details.", "text" : { "en_US": "The head of the sales department spoke first.", "fa_IR": "ابتدا رئیس بخش فروش صحبت کرد", "sv_FI": "Först talade chefen för försäljningsavdelningen" } }
{ "_id": 3, "page_updated_by": { "last_name": "LEWINSKY", "first_name": "Brièle", "email": "lewinsky@example.com", "phone": "(123).456.9870" }, "title": "The regular board meeting", "message": "try to sign-in", "text" : { "en_US": "<body>We'll head out to the conference room by noon.</body>" } }
{ "_id": 4, "page_updated_by": { "last_name": "LEVINSKI", "first_name": "François", "email": "levinski@example.com", "phone": "123-456-8907" }, "title": "The daily huddle on tHe StandUpApp2", "message": "write down your signature or phone №", "text" : { "en_US": "<body>This page has been updated with the items on the agenda.</body>" , "es_MX": "La página ha sido actualizada con los puntos de la agenda.", "pl_PL": "Strona została zaktualizowana o punkty porządku obrad." } }
자세히 알아보기
사용자 지정 분석기를 만드는 방법에 대해 자세히 알아보려면 다음 참조 페이지를 확인하세요.
참고
Atlas UI에서 Visual Editor을(를) 사용하여 사용자 지정 분석기를 추가하는 경우 Atlas UI는 Custom Analyzers 섹션에 분석기에 대한 다음 세부 정보를 표시합니다.
이름 | 사용자 지정 분석기를 식별하는 레이블입니다. |
사용 분야 | 사용자 지정 분석기를 사용하는 필드입니다. 사용자 지정 분석기를 사용하여 필드를 분석하지 않는 경우 값은 없음입니다. |
문자 필터 | 사용자 지정 분석기 에 구성된 MongoDB Search 문자 필터입니다. |
토크나이저 | 사용자 지정 분석기 에 구성된 MongoDB Search 토크나이저 . |
토큰 필터 | 사용자 지정 분석기 에 구성된 MongoDB Search 토큰 필터입니다. |
작업 | 사용자 지정 분석기에서 수행할 수 있는 작업을 나타내는 클릭 가능한 아이콘입니다.
|