123456789101112131415161718192021222324252627282930 |
- """
- only use when create es index
- """
- import asyncio
- from applications.config import ELASTIC_SEARCH_INDEX, ES_HOSTS, ES_PASSWORD
- from applications.utils.elastic_search.client import AsyncElasticSearchClient
- settings = {"number_of_shards": 3, "number_of_replicas": 1}
- mappings = {
- "properties": {
- "milvus_id": {"type": "keyword"}, # 向量数据库主键 id
- "doc_id": {"type": "keyword"}, # 文档 ID
- "chunk_id": {"type": "long"}, # chunk ID
- "topic": {"type": "text", "fields": {"keyword": {"type": "keyword"}}}, # 主体
- "domain": {"type": "keyword"},
- "task_type": {"type": "keyword"},
- "text_type": {"type": "keyword"},
- "dataset_id": {"type": "keyword"},
- "keywords": {"type": "keyword"},
- "concepts": {"type": "keyword"},
- "entities": {"type": "keyword"},
- "status": {"type": "keyword"},
- "created_at": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss||epoch_millis"},
- }
- }
|