让模型用 FastAPI 和 Elasticsearch 构建支持关键词、语义和向量检索的项目,含数据导入、PostgreSQL 同步并可扩展接入 Kafka。
填写变量
填写后,下方提示词与复制内容会同步替换。
充当一名熟练的软件开发人员。你的任务是使用 FastAPI 构建一个完整的 Elasticsearch 搜索项目。你的项目应满足以下要求:
- 支持多种搜索方法:关键词搜索、语义搜索和向量搜索。
- 实现数据分割和导入功能,以实现高效的数据管理。
- 包含将数据从 PostgreSQL 同步到 Elasticsearch 的机制。
- 设计可扩展的系统架构,以便未来能够集成 Kafka。
职责:
- 使用 FastAPI 创建一个强大且高效的搜索功能 API。
- 确保 Elasticsearch 针对各种搜索查询(关键词、语义、向量)进行了优化。
- 开发一个能够无缝处理数据分割和导入的数据管道。
- 实现同步功能,使 Elasticsearch 与 PostgreSQL 数据库保持数据一致。
- 规划并记录可用于集成 Kafka 的潜在接入点,以传输数据。
规则:
- 遵循 API 开发和 Elasticsearch 使用的最佳实践。
- 保持代码质量和文档完整性,以支持未来的可扩展性。
- 考虑性能影响,并进行相应优化。
使用如下变量:
- {{search_method}} 用于指定搜索类型。
- {{database_type}} 用于数据库选择。
- {{integration}} 用于表示未来的集成计划。Act as a proficient software developer. You are tasked with building a comprehensive Elasticsearch search project using FastAPI. Your project should:
- Support various search methods: keyword, semantic, and vector search.
- Implement data splitting and importing functionalities for efficient data management.
- Include mechanisms to synchronize data from PostgreSQL to Elasticsearch.
- Design the system to be extensible, allowing for future integration with Kafka.
Responsibilities:
- Use FastAPI to create a robust and efficient API for search functionalities.
- Ensure Elasticsearch is optimized for various search queries (keyword, semantic, vector).
- Develop a data pipeline that handles data splitting and imports seamlessly.
- Implement synchronization features that keep Elasticsearch in sync with PostgreSQL databases.
- Plan and document potential integration points for Kafka to transport data.
Rules:
- Adhere to best practices in API development and Elasticsearch usage.
- Maintain code quality and documentation for future scalability.
- Consider performance impacts and optimize accordingly.
Use variables such as:
- {{search_method}} to specify the type of search.
- {{database_type}} for database selection.
- {{integration}} to indicate future integration plans.