Skip to content

Conversation

@omdxp
Copy link
Contributor

@omdxp omdxp commented Dec 21, 2024

  • Add deleteAllDocuments search service method.
  • Index models that represent the contributions, contributors and projects.
  • Bug fix
  • New feature
  • Other

@omdxp omdxp self-assigned this Dec 21, 2024
@github-actions github-actions bot added feature Feature api API related changes ( api folder ) labels Dec 21, 2024
… deletion of project, contribution, and contributor items
@omdxp omdxp mentioned this pull request Dec 21, 2024
4 tasks
@omdxp omdxp marked this pull request as ready for review December 21, 2024 16:41
@omdxp omdxp requested a review from ZibanPirate December 21, 2024 16:42
Copy link
Member

@ZibanPirate ZibanPirate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your suggested way is:
1- collect all documents to index in an array
2- bulk-delete all currently indexed documents from search db
3- bulk-index new documents from scratch into search db

meanwhile, this cron works slightly differently, where:
1- doesn't collect models, but instead upsert them on the spot to db
2- doesn't delete all models, but only outdated ones (runId is different)
3- doesn't have a third step

So, ... for the search implementation to follow along with this cron implementation it should:
1- index (upsert) each document on the spot, don't save it to an array and do that later.
2- bulk-delete all documents that are outdated (runId is different)

I added comments on how to do that

@omdxp omdxp requested a review from ZibanPirate December 21, 2024 17:32
@omdxp omdxp requested a review from ZibanPirate December 21, 2024 18:55
@ZibanPirate ZibanPirate added this to the Search functionality milestone Dec 21, 2024
@github-actions github-actions bot added the models models package label Dec 21, 2024
…y SearchItem type

chore: introduce setupIndexes search method that ensure indexes and add update filterable attributes
@omdxp omdxp force-pushed the index-models-during-cron-job branch from 7c7100b to 229e341 Compare December 21, 2024 22:32
@omdxp omdxp requested a review from ZibanPirate December 22, 2024 15:56
@github-actions github-actions bot removed the models models package label Dec 22, 2024
Copy link
Member

@ZibanPirate ZibanPirate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you a lot @omdxp ! one step forward to having search in the website

@omdxp omdxp merged commit efe56d0 into main Dec 22, 2024
20 checks passed
@omdxp omdxp deleted the index-models-during-cron-job branch December 22, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API related changes ( api folder ) feature Feature

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants