情報を強化する人工知能機能が組み込まれた Azure の検索サービスで、関連するコンテンツの特定と探索を大規模に支援します。
Hey Watanabe, it sounds like you're trying to figure out how to integrate Azure Cosmos DB for PostgreSQL with Azure AI Search for indexing your data. Currently, as you mentioned, there’s no direct support for Cosmos DB for PostgreSQL as a data source in Azure AI Search, which means you will need to use an alternative approach to get your data indexed.
Here are two potential methods you can consider, which you already identified:
1. Application-side Push Integration
You can set up an application or Azure Function to periodically fetch data from Cosmos DB for PostgreSQL and then use the Azure Search SDK or REST API to update the indexes. This method allows you to control how often the data is synced and could be cost-effective since you can run it based on your requirements.
Steps:
- Set up an Azure Function or a scheduled job in your application to query data from your Cosmos DB.
- Use the Azure Search SDK or REST API to push the data to your Azure AI Search service.
- Since your data doesn't change frequently, batching this operation could help reduce costs.
2. Intermediate Storage with Blob/ Data Lake
This method involves exporting data from your PostgreSQL database to an intermediary storage service, like Azure Blob Storage or Data Lake, and then using an indexer in Azure AI Search to process the stored files.
Steps:
- Use an Azure Function or scheduled job to periodically export data from Cosmos DB for PostgreSQL to Blob Storage or Data Lake in a suitable format (like JSON/CSV).
- Configure an Azure AI Search indexer to read from that Blob/ Data Lake to index the data.
Best Practices and Considerations
- Cost Management: Evaluate the cost differences between these two approaches based on frequency, data volume, and Azure Function executions.
- Error Handling: Implement error handling and logging to manage any failures during data retrieval or index updates.
- Scalability: Ensure that whichever approach you choose can scale effectively with your data size and update frequency.