2026 01 19
2026-01-19¶
Elastic Search Immense Term¶
-
immense term
- ES에 글 저장시
content필드에서 에러 발생 -> 인덱싱 실패Document contains at least one immense term in field="content" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[91, -20, -117, -84, -20, -126, -84, -21, -91, -68, 32, -20, -96, -100, -20, -103, -72, -19, -107, -100, 32, -22, -76, -111, -22, -77, -96, 32, -20, -102]...', original message: bytes can be at most 32766 in length; got 48565
content필드가 text가 아닌 keyword 타입으로 지정됨- keyword는 토크나이징 없이 문자열 전체를 Term으로 저장
- 긴 글이 한번에 넘어오면서 단어로 간주되고, 32KB를 넘기자 에러
immense term은 단일 토큰(Term)의 크기가 32KB를 넘길때 발생keyword: 문장 전체를 1개의 토큰으로 간주함. 전체 길이가 32KB를 안넘어야 함.text: 분석기가 긴 문장을 토큰으로 쪼개줌. 전체 글이 길어도 개별 토큰이 32KB를 안넘으면 유효. (긴 글이 인입되면 중간중간 space를 넣어주면 해당 에러 방지 가능)
- ES에 글 저장시
- Keyword
- 토크나이징 X
- 통째로 1개 저장
- 검색어는 정확히 일치할 것
- Wildcard Query를 통해 mysql like 검색하듯이 검색은 가능
- ES의 장점인 역색인 구조를 잘 활용하진 못하는 구조
- Text
- 토크나이징 O
- 단어별로 쪼개서 저장
- Full-Text
- immense term도 위험도가 덜함