26 Nov, 2025
2 commits
25 Nov, 2025
1 commit
-
mappings/search_products.json - 完整的ES索引配置(settings + mappings) 基于 docs/索引字段说明v2-mapping结构.md 简化 mapping_generator.py 移除所有config依赖 直接使用 load_mapping() 从JSON文件加载 保留工具函数:create_index_if_not_exists, delete_index_if_exists, update_mapping 更新数据导入脚本 scripts/ingest_shoplazza.py - 移除ConfigLoader依赖 直接使用 load_mapping() 和 DEFAULT_INDEX_NAME 更新indexer模块 indexer/__init__.py - 更新导出 indexer/bulk_indexer.py - 简化IndexingPipeline,移除config依赖 创建查询配置常量 search/query_config.py - 硬编码字段列表和配置项 使用方式 创建索引: from indexer.mapping_generator import load_mapping, create_index_if_not_existsfrom utils.es_client import ESClientes_client = ESClient(hosts=["http://localhost:9200"])mapping = load_mapping()create_index_if_not_exists(es_client, "search_products", mapping) 数据导入: python scripts/ingest_shoplazza.py \ --db-host localhost \ --db-database saas \ --db-username root \ --db-password password \ --tenant-id "1" \ --es-host http://localhost:9200 \ --recreate 注意事项 修改mapping:直接编辑 mappings/search_products.json 字段映射:spu_transformer.py 中硬编码,与mapping保持一致 config目录:保留但不再使用,可后续清理 search模块:仍依赖config