illegal_argument_exception_fielddata: illegal_argument_exception: Fielddata is disabled on text fields by default. Set fielddata=true on [your_field] in order to load fielddata in memory
Elasticsearch의미
분석된 text 필드에 aggregation, 정렬 또는 스크립트를 시도했다. 이러한 작업은 메모리 비용이 큰 fielddata가 필요하기 때문에 text 필드에서 기본적으로 비활성화되어 있다.
원인
text 필드에 직접 aggregation/정렬을 적용함. Elasticsearch에서 text는 전문 검색에, keyword는 정확한 값 기반 aggregation/정렬에 사용되며, 둘을 혼용하면 이 오류가 발생한다.
해결 방법
aggregation/정렬에는 필드의 keyword 하위 필드를 사용한다(예: "my_field.keyword"). 필드가 text 전용이라면 매핑에 keyword 하위 필드(multi-field)를 추가하고 _reindex를 실행한다. text 필드에 fielddata를 활성화(fielddata=true)할 수는 있지만 높은 메모리 소비와 circuit breaker 위험 때문에 권장하지 않으며, 불가피한 경우에만 사용한다.
같은 데이터베이스의 다른 항목
- circuit_breaking_exceptionCircuitBreakingException[[parent] Data too large, data for [<...>] would be [...], which is larger than the limit of [...]]
- mapper_parsing_exceptionmapper_parsing_exception: failed to parse field [...] of type [...]
- strict_dynamic_mapping_exceptionstrict_dynamic_mapping_exception: mapping set to strict, dynamic introduction of [...] within [...] is not allowed
- search_phase_execution_exceptionsearch_phase_execution_exception: all shards failed / Failed to execute phase [query]
- too_many_clausestoo_many_clauses: maxClauseCount is set to 1024 (query contains too many clauses)
- version_conflict_engine_exceptionversion_conflict_engine_exception: [_doc][id]: version conflict, current version [x] is different than the one provided [y] (HTTP 409)
- document_missing_exceptiondocument_missing_exception: [_doc][id]: document missing