Filter documents for targeted processing and analysis
Data Slices are filtered subsets of your data based on metadata. They allow you to focus on specific segments of your document repository without affecting the entire dataset.
Use Data Slices to create focused workflows. For example, process only untagged documents to avoid reprocessing, or create a slice of high-priority documents for immediate attention.
# Export a data slice to a destinationresult = client.dataslice.export_metadata( dataslice_name="2024-contracts", export_format="csv",)print(f"Exported to: {result.file_path}")# Export to a vector databaseclient.destination.export( destination_name="my-qdrant", dataslice_name="2024-contracts", export_level="chunk", export_nodes=True,)
Copy
Ask AI
# List all data slicesslices = client.dataslice.list()for s in slices.dataslices: print(f"{s.dataslice_name}: {s.document_count} docs")# Delete a data sliceclient.dataslice.delete(dataslice_name="old-slice")print("Data slice deleted")