핵심 요약
Elasticsearch 9의 Elastic Inference Service로 임베딩 자동 생성·관리. BM25 + KNN 하이브리드 검색으로 사내 검색 NDCG +18%, click-through +24%. 별도 임베딩 파이프라인 없음. 사후 운영.
1. inference endpoint 등록
PUT _inference/text_embedding/multilingual
{
"service": "elasticsearch",
"service_settings": {
"num_allocations": 2,
"model_id": ".multilingual-e5-large"
}
}
2. 인덱스 설계
PUT docs
{
"mappings": {
"properties": {
"title": { "type": "text" },
"embed": { "type": "semantic_text", "inference_id": "multilingual" }
}
}
}
semantic_text 타입이 자동 임베딩. 색인·검색 시 별도 코드 0.
3. 하이브리드 검색 — RRF
POST docs/_search
{
"retriever": {
"rrf": {
"retrievers": [
{ "standard": { "query": { "match": { "title": "kubernetes" } } } },
{ "knn": { "field": "embed", "query_vector_builder": { "text_embedding": { "model_id": "multilingual", "model_text": "kubernetes networking" } } } }
]
}
}
}
4. 성능
- 색인 처리량 약 12K doc/초(임베딩 포함)
- 검색 p50 38ms, p99 142ms
- 임베딩 노드 비용 월 $420 추가
- NDCG@10: 0.62 → 0.73
5. 함정
- 임베딩 모델 변경 = 재색인 — 모델 선택이 운영 결정
- ELSER vs E5 — ELSER는 sparse, 디스크 작고 정확. E5는 dense, 다국어 강점
- allocation 부족 — inference 큐 폭증 시 색인 지연, allocation·노드 분리
- ranking 평가 — relevance lab 필수, 변경 후 회귀 측정

댓글 0