create_file_extension method

create_file_extension

Creates a filter that skips documents without the specified extensions.

def create_file_extension(cls, extensions):
    ...
Parameter Type Description
extensions list[str] The list of allowable extensions.

Returns: DocumentFilter: A document filter by document extension.

Example

from groupdocs.search.options import DocumentFilter

# Allow only .htm and .html files
filter = DocumentFilter.create_file_extension(".htm", ".html")
print(filter)

See Also