You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IndexWriter.update_document method performs really poorly when invoked several times on index with an unique field. The reason is that it leads to constructing searcher for every updated document (what in turn leads to reading index from disk several times):
What should be considered is to create one searcher per writer (lazily once it is needed for the first time) and close it when writer is closed.
This can be currently workarounded by copying the update_document logic and constructing searcher outside. For example I've done this in WeblateOrg/weblate@91cb357
The text was updated successfully, but these errors were encountered:
nijel
changed the title
The update_document performs poorely if called multiple times
The update_document performs poorly if called multiple times
Jan 26, 2019
The
IndexWriter.update_document
method performs really poorly when invoked several times on index with an unique field. The reason is that it leads to constructing searcher for every updated document (what in turn leads to reading index from disk several times):whoosh/src/whoosh/writing.py
Lines 480 to 489 in c823d16
What should be considered is to create one searcher per writer (lazily once it is needed for the first time) and close it when writer is closed.
This can be currently workarounded by copying the
update_document
logic and constructing searcher outside. For example I've done this in WeblateOrg/weblate@91cb357The text was updated successfully, but these errors were encountered: