add method

On this page

add

Indexes documents from streams or structures.

def add(self, documents, passwords, options):
    ...
Parameter Type Description
documents List[Document] The documents from stream or structure.
passwords List[str] The document passwords.
options IndexingOptions The add options.

Example

import datetime
import os

from groupdocs.search.common import Document
from groupdocs.search.options import IndexingOptions

# `node` is the master node of a configured and started search network
indexer = node.indexer

file_path = "./documents/document.pdf"
with open(file_path, "rb") as stream:
    document = Document.create_from_stream(
        os.path.basename(file_path),
        datetime.datetime.fromtimestamp(os.path.getmtime(file_path)),
        ".pdf",
        stream)
    # One password per document; None for a document without one
    indexer.add([document], [None], IndexingOptions())

add

Performs an indexing operation and adds the extracted data to the search network.

def add(self, data, options):
    ...
Parameter Type Description
data List[ExtractedData] The extracted data.
options IndexingOptions The indexing options.

Aliases

These names call add too, limited to the overloads listed.

Alias Accepts
add_ilist add_ilist(documents, passwords, options)
add_ilist(data, options)

See Also

On this page