AttributeChangeBatch class

AttributeChangeBatch class

Represents a container for attribute changes.

Learn more

The AttributeChangeBatch type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the AttributeChangeBatch class.

Methods

Method Description
add Adds the specified attributes to the specified indexed document.
add Adds the specified attributes to the specified indexed documents.
add_to_all Adds the specified attributes to all documents in the index.
clear Removes all attributes from all documents in the index.
remove Removes the specified attributes from the specified indexed document.
remove Removes the specified attributes from the specified indexed documents.
remove_all Removes all attributes from the specified indexed document.
remove_all Removes all attributes from the specified indexed documents.
remove_from_all Removes the specified attributes from all documents in the index.

Example

import os
from groupdocs.search.common import AttributeChangeBatch

# Create a batch of attribute changes
batch = AttributeChangeBatch()
batch.add(os.path.abspath("./documents/relativity-lecture.pdf"), ["main"])
batch.add(os.path.abspath("./documents/einstein-biography.txt"), ["main", "biography"])

# Apply the changes to the index
index.change_attributes(batch)

See Also