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

Speed up incremental search reindex #530

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Speed up incremental search reindex
DavidMStraub committed Aug 4, 2024

Verified

This commit was signed with the committer’s verified signature.
commit d9fd720054845998011271835e04dd3cb87087e1
8 changes: 6 additions & 2 deletions gramps_webapi/api/search/indexer.py
Original file line number Diff line number Diff line change
@@ -203,14 +203,18 @@ def progress(i):

# add objects
for class_name, handles in update_info["new"].items():
obj_dicts = []
for handle in handles:
obj_dicts.append(obj_strings_from_handle(db_handle, class_name, handle))
i = progress(i)
self.add_or_update_object(handle, db_handle, class_name)
self._add_objects(obj_dicts)
# update objects
for class_name, handles in update_info["updated"].items():
obj_dicts = []
for handle in handles:
obj_dicts.append(obj_strings_from_handle(db_handle, class_name, handle))
i = progress(i)
self.add_or_update_object(handle, db_handle, class_name)
self._add_objects(obj_dicts)

@staticmethod
def _format_hit(hit, rank) -> Dict[str, Any]: