add method
Leave feedback
On this page
Performs indexing operation by adding a file or folder specified by an absolute or relative path; documents in all subfolders are indexed.
def add(self, path):
...
| Parameter | Type | Description |
|---|---|---|
| path | str |
The path to a file or folder to be indexed. |
from groupdocs.search import Index
def on_file_indexing(sender, args):
print("Indexing:", args.document_full_path)
with Index("./index") as index:
index.events.file_indexing += on_file_indexing
index.add("./documents")
Adds a file or folder by an absolute or relative path, indexing documents from all subfolders.
def add(self, path, options):
...
| Parameter | Type | Description |
|---|---|---|
| path | str |
The path to a file or folder to be indexed. |
| options | IndexingOptions |
The indexing options. |
Performs indexing operation. Adds files or folders by an absolute or relative path. Documents from all subfolders will be indexed.
def add(self, paths):
...
| Parameter | Type | Description |
|---|---|---|
| paths | list[str] |
The paths to files or folders to be indexed. |
from groupdocs.search import Index
index = Index("./index")
index.add("./documents")
Adds files or folders by an absolute or relative path, indexing documents from all subfolders.
def add(self, paths, options):
...
| Parameter | Type | Description |
|---|---|---|
| paths | list[str] |
The paths to files or folders to be indexed. |
| options | IndexingOptions |
The indexing options. |
from groupdocs.search import Index
from groupdocs.search.options import IndexingOptions
def on_file_indexing(sender, args):
print("Indexing:", args.document_full_path)
with Index("./index") as index:
index.events.file_indexing += on_file_indexing
index.add(["./documents"], IndexingOptions())
Indexes documents from the file system, a stream, or a structured source.
def add(self, documents, options):
...
| Parameter | Type | Description |
|---|---|---|
| documents | list[Document] |
The documents from the file system, a stream, or a structured source. |
| options | IndexingOptions |
The indexing options. |
Performs an indexing operation and adds the extracted data to the index.
def add(self, data, options):
...
| Parameter | Type | Description |
|---|---|---|
| data | list[ExtractedData] |
The extracted data. |
| options | IndexingOptions |
The indexing options. |
These names call add too, limited to the overloads listed.
| Alias | Accepts |
|---|---|
add_file |
add_file(path, options)add_file(path) |
add_string |
add_string(path, options)add_string(path) |
add_files |
add_files(paths, options)add_files(paths) |
add_strings |
add_strings(paths, options)add_strings(paths) |
add_document |
add_document(documents, options) |
add_extracted_data |
add_extracted_data(data, options) |
- class
Index
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.