Closed GDeane closed 3 months ago
Implement an API to reindex the search engine whenever there is an update in the backend database.
relates: #50 - These two should be tested together blocked by: elasticsearch setup
Ensure the search index is updated with the latest listings information.
5.1.4.2
Reindex Search Results When Listing Created:
reindexListingCreated
Reindex Search Results When Listing Edited:
reindexListingEdited
Reindex Search Results When Listing Deleted:
reindexListingDeleted
Listing Created Reindexing:
/api/search/reindex/listing-created
Listing Edited Reindexing:
/api/search/reindex/listing-edited
Listing Deleted Reindexing:
/api/search/reindex/listing-deleted
Scenario: Successful Reindexing on Listing Creation
Scenario: Error Handling for Missing Parameters on Listing Creation
Scenario: Successful Reindexing on Listing Edit
Scenario: Successful Reindexing on Listing Deletion
Feature Description
Implement an API to reindex the search engine whenever there is an update in the backend database.
relates: #50 - These two should be tested together blocked by: elasticsearch setup
Problem You're Trying to Solve
Ensure the search index is updated with the latest listings information.
Related External Resources
5.1.4.2
Acceptance Criteria
Unit Tests
Reindex Search Results When Listing Created:
reindexListingCreated
function processes a valid request payload correctly (creates the listing in the index).reindexListingCreated
function returns an appropriate success response.reindexListingCreated
function handles missing parameters in the request payload and returns an error response.reindexListingCreated
function correctly formats the listing data for reindexing.Reindex Search Results When Listing Edited:
reindexListingEdited
function processes a valid request payload correctly (edits the listing in the index).reindexListingEdited
function returns an appropriate success response.reindexListingEdited
function handles missing parameters in the request payload and returns an error response.reindexListingEdited
function correctly formats the edited listing data for reindexing.Reindex Search Results When Listing Deleted:
reindexListingDeleted
function processes a valid request payload correctly (deletes the listing from the index).reindexListingDeleted
function returns an appropriate success response.reindexListingDeleted
function handles missing parameters in the request payload and returns an error response.reindexListingDeleted
function correctly extracts the listing ID for reindexing.Integration Tests
Acceptance Tests
Listing Created Reindexing:
/api/search/reindex/listing-created
endpoint is called with the correct payload,Listing Edited Reindexing:
/api/search/reindex/listing-edited
endpoint is called with the correct payload,Listing Deleted Reindexing:
/api/search/reindex/listing-deleted
endpoint is called with the correct payload,Example Test Scenarios
Scenario: Successful Reindexing on Listing Creation
/api/search/reindex/listing-created
is called with the correct payload,Scenario: Error Handling for Missing Parameters on Listing Creation
/api/search/reindex/listing-created
is called with a missing parameter,Scenario: Successful Reindexing on Listing Edit
/api/search/reindex/listing-edited
is called with the correct payload,Scenario: Successful Reindexing on Listing Deletion
/api/search/reindex/listing-deleted
is called with the correct payload,