Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding save records endpoint #334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

awaisdar001
Copy link

@awaisdar001 awaisdar001 commented Dec 24, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Related Issue Fix algolia/algoliasearch-client-python#561
Need Doc update yes

Describe your change

The provided change introduces an optimized solution for updating specific records within the Algolia search index efficiently. It addresses the challenges faced when dealing with a large number of products that require periodic updates.

What problem is this fixing?

The initial problem involved the impracticality of individually indexing a potentially large number of products, resulting in excessive API requests and a time-consuming process. The proposed solution introduces a save_records method that efficiently handles batch updates for specific products, streamlining the indexing process.

Key Changes Made:

  1. The save_records method has been added to handle batch updates for specific records in the Algolia index. This method efficiently processes records in batches, improving the overall time and resource utilization.

  2. The method utilizes a temporary index (__tmp_index) for storing and processing the updated records in batches.

  3. Records that should not be indexed are marked for deletion, ensuring the removal of outdated records from the index.

The delete_records method has been introduced to handle the deletion of multiple records from the Algolia index.

Impact and Benefits:

  • The proposed solution significantly reduces the time and resources required for updating a subset of records within the index.
  • Enhances the overall user experience, particularly in scenarios where only specific products within a collection need updating.
  • The batch processing approach improves efficiency and reduces the number of API calls, making it a more scalable solution.

The changes provide a more streamlined and efficient workflow for handling periodic updates, addressing the outlined challenges. This enhancement contributes to a more responsive and user-friendly Algolia integration.

Additional Notes:

With limited experience in the codebase, I thoroughly explored the repository before proposing this solution. While I acknowledge the potential for oversight, I aimed to provide a preliminary solution and showcase a possible approach. Feedback and corrections are welcomed as opportunities for learning and improvement. Thank you for your guidance.

Please review the changes and provide feedback on the proposed solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request for API Endpoint to Update Specific Products in Algolia Search Index
1 participant