Re-indexes documents that have been changed or deleted since the last update and adds new files that have been added to the indexed folders.
The update operation reindexes documents that have been changed, deleted, or added to the indexed folders. Changing the filter specified by the document_filter property of the IndexSettings class can also affect the list of indexed documents.
defupdate(self):...
Example
fromgroupdocs.searchimportIndexindex_folder="./MyIndex"documents_folder="./documents"index=Index(index_folder)# Create or open the indexindex.add(documents_folder)# Index documents from the folder# Modify, delete, or add files in the documents folder as neededindex.update()# Re-index changed, deleted, and new documents```
update
Re-indexes documents that have been changed or deleted since the last update and adds new files that have been added to the indexed folders.
The update operation reindexes modified, removed, or newly added documents in the indexed folders. Changing the document_filter property of IndexSettings can also affect which documents are indexed.
defupdate(self,options):...
Parameter
Type
Description
options
UpdateOptions
The update options.
Example
fromgroupdocs.searchimportIndexfromgroupdocs.search.optionsimportUpdateOptionsindex_folder="./MyIndex"documents_folder="./documents"# Create or open the index in the specified folderindex=Index(index_folder)# Index documents from the specified folderindex.add(documents_folder)# Modify, delete, or add documents in the documents folder as needed# Configure update options (e.g., set the number of indexing threads)options=UpdateOptions()options.threads=2# Update the index with the specified optionsindex.update(options)
Aliases
These names call update too, limited to the overloads listed.