AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

패싯 검색을 위해 문자열 필드를 인덱싱하는 방법

You can use the MongoDB Search stringFacet type to index string fields for faceting, which allows you to run a facet operator query on that field. MongoDB Search doesn't apply the analyzer when indexing string fields for faceting.

MongoDB Search는 유형으로 인덱싱된 필드에 대한 패싯 연산자 쿼리만 stringFacet 지원합니다. 동일한 필드 에 대해서도 일반 검색 수행하려면 필드 string 유형으로 인덱스 해야 합니다.

내장된 문서의 문자열 필드를 패싯 하려면 상위 필드를 문서 유형으로 인덱스 해야 합니다. 내장된 문서 내부의 문자열 필드 패싯 경우 MongoDB Search는 일치하는 상위 문서 수에 대해서만 패싯 수를 반환합니다.

MongoDB Search는 string 패싯에 대해 값을 동적으로 인덱스 하지 않습니다. 정적 매핑 을 사용하여 패싯의 string 값을 인덱스 해야 합니다. Atlas UI 의 비주얼 편집기 또는 JSON 편집기를 사용하여 필드를 유형으로 string 인덱스 number 할 수 있습니다.

stringFacet 유형에 대한 인덱스를 정의하려면 Atlas UI에서 원하는 구성 방법을 선택한 다음 데이터베이스와 컬렉션을 선택하세요.

MongoDB Search stringFacet 유형에는 다음과 같은 매개 변수가 있습니다.

UI 필드 이름
JSON Option
유형
필요성
설명
Data Type

type

문자열

필수 사항

Human-readable label that identifies this field type. Value must be stringFacet. MongoDB Search truncates BSON string values indexed as the stringFacet type to around 8000 UTF-16 code units.

The following index definition example uses the sample_mflix.movies collection. If you have the sample data already loaded on your cluster, you can use the Visual Editor or JSON Editor in the Atlas UI to configure the index. After you select your preferred configuration method, select the database and collection, and refine your index to add field mappings.

The following index definition for the sample_mflix.movies collection in the sample dataset indexes the genres field as stringFacet for faceting.

The following index definition for the sample_mflix.movies collection in the sample dataset indexes the genres field as stringFacet and string types to return the following types of results for your queries:

  • MongoDB Search facet (MongoDB Search 연산자)를 사용하는 쿼리에 대한 메타데이터 결과입니다.

  • 텍스트, 구문 및 텍스트 검색 수행하는 기타 연산자와 같은 MongoDB Search 연산자를 사용하여 쿼리에 대한 결과를 검색합니다.

facet 컬렉터에 대한 자세한 내용과 쿼리 예시를 보려면 예시를 참조하세요.

패싯 정의로 인덱스 만들고 facet 컬렉터를 사용하여 해당 인덱스 쿼리 방법을 학습하려면 MongoDB Search에서 패싯을 사용하는 방법 튜토리얼을 참조하세요.

stringFacet을 사용하여 페이지가 매겨진 결과로 패싯 검색을 실행하는 인덱스 및 쿼리 예시를 보려면, 페이지가 매겨진 결과로 패싯 사용을 참조하세요.