Aiimi Insight Engine
User GuidesAiimi
  • Introducing Aiimi Insight Engine
  • Architecture
    • Overview and Key Concepts
    • Hosting Options
    • Architecture and How It Works
      • Agent Servers
        • Security Agent
        • Source Agent
        • Content Agent
        • Enrichment Agent
        • Job Agent
        • OCR Agent
        • Migration Agent
        • Tika Agent
      • Repository
        • Data Node
        • Proxy Node
        • Kibana Node
      • Gateway and User Interface
      • Document and Data Sources
    • Deployment Options
    • Security
      • User Security
      • Data and Document Security
      • Source System Security
      • Firewalling
      • Agent Servers
      • Repository
      • Gateway (Web Server)
      • Tools & Utilities
  • Installation
    • Elastic and Kibana Install (Windows)
    • Aiimi Insight Engine Installation (Windows)
      • Installation Security
      • Certificates in a Key Vault
      • SAR Configuration
      • CSOM Bridge Set Up
      • AI Studio
    • AI Services
      • Prerequisites
      • AI Enrichment Service
        • Installation and Setup
        • Enabling Enrichment Steps
        • Using AI Enrichment Steps
        • Performance and Concurrency
      • AI Model Service
        • Installation and Setup
        • Enabling Providers
        • Private Generative AI
        • Azure Open AI
        • Enabling AI History
        • HTML Cleaner Service
      • Configuration of Logging
      • Offline Set-up of Models
      • Using SSL
      • Running as a Service (Windows)
      • Using GPUs
      • AI and Semantic Search Set Up
        • Open & Closed Book AI
        • Semantic Search
          • Vectors for Semantic Search
          • Source Configuration
          • Sentence Transformer Models
          • Enrichment
          • Kibana
          • Final Search Flow
    • Email Threading Upgrade
  • Run Books
    • SharePoint Online Connector
      • Migrating ACS to Azure AD with Sites.Read.All
      • Migrating ACS to Azure AD with Sites.FullControl.All
  • Control Hub
    • Agents
      • Configurations
        • Config Management
        • Security Configurations
          • Security - General
          • Security - Source
            • Active Directory
            • Atlassian
            • Azure Active Directory
            • Builtin Security
            • Miro Security
            • Google Directory
            • SharePoint Security
            • Slack Security
          • Security - Sync
          • Security - Agents
          • Security - Scheduling
        • Source Configurations
          • Source - General
          • Source - Source
            • Alfresco Kafka
            • Azure Blob Storage
            • BBC Monitoring
            • Big Query Cataloguer
            • BIM360
            • CSV Data Loader
            • Confluence
            • Content Server
            • Data File Cataloguer
            • Document Store
            • DocuSign
            • Dropbox
            • Exchange 365
            • Filesystem
            • Google Bucket
            • Google Drive
            • Google Vault
            • Jira
            • JSON Data Loader
            • Livelink
            • Microsoft Teams
            • Mimecast
            • Miro
            • ODBC Data Loader
            • PowerBi Cataloguer
            • Reuters Connect
            • ShareFile
            • SharePoint
              • Azure Portal and Azure AD Authentication
              • Sensitivity Labels
            • SharePoint Legacy
            • SQL Server Cataloguer
            • Slack
            • Versioned Document Store
            • Websites
            • XML Data Loader
          • Source - Crawl
          • Source - Agents
          • Source - Schedule
          • Source - Advanced
        • Enrichment Configurations
          • Creating a Pipeline
            • General
            • Steps
              • AccessMiner
              • AI Classification
              • Apply Sensitivity Label
              • Anonymiser
              • CAD Extractor
              • Checksum
              • Content Retrieval
              • Copy
              • Data Rule Processor
              • Delete
              • Direct Copy
              • Email Extractor
              • Entity Rule Processor
              • External Links
              • Geotag
              • Google NLP Extractor
              • Google Vision Extractor
              • Metrics Calculation
              • Microsoft Vision Extractor
              • OcrRest
              • Office Metadata
              • PCI Extractor
              • REST
              • Set Document Risk
              • Text Cleaner
              • Tika Text Extraction
              • Trie Entity Extractor
              • Update Metadata
            • Filters
            • Agents
            • Schedule
            • Advanced
        • OCR Engine
        • Job Configurations
          • General
          • Job
            • AutomatedSearchJob
            • Command Job
            • ElasticJob
            • Extended Metrics Job
            • File Extractor
            • GoogleVaultSAR
            • Google Drive Last Access Date
            • Nightly Events Processor Job
            • Notifications Processor Job
            • Portal Sync Job
            • Purge Job
            • SAR Archiving
            • Text Content Merge Job
          • Output
          • Agents
          • Scheduling
        • Migration Configuration
          • General
          • Filter
          • Metadata Mappings
          • Agents
          • Scheduling
          • Advanced
      • Stats
        • Data Views
    • Security
      • User Settings
      • Credentials
      • Authentication
      • Application Access
      • Auditing
      • Descriptor Groups
      • Uploads
    • Mappings
      • Entities
        • Manage Entity Groups
        • Create an Entity
        • Manage an Entity
      • Models
        • Create a New Model
        • Find a Model
        • Enable or Disable a Model
      • Vectors
      • Rank Features
    • Search Settings
      • Search Relevancy
        • Core Settings
        • Makers Algorithm
        • Filename Boost Layer
        • Minimum Matching Terms Filter
        • Field Boost
        • Modified Date Boosting
        • Hit Highlighting
        • Why My Search Matched
        • Data Search Strategy
      • Bulk Search
        • Managing a Bulk Search
      • Filtering
      • Search Performance
      • Related Results
      • Featured Links
    • AI Settings
      • Search Flows
        • Search Flow Types
        • General Configuration
        • Query and Prompt Classification
        • Search Steps
        • Smart Filtering
        • Model Steps
        • Result Templates
        • System Prompt
      • Tools
        • Concepts
        • Import OOTB Tools
        • Built In Functions and Tools
        • Create and Edit Tools
      • Classifications
        • Class
        • Class Rules
        • AI Classification
    • User Interface
      • Thumbnails
      • Code of Conduct
      • Visualisations
        • Related Result Connections Diagram
        • Event Timeline
        • Timeline Lens Activity Chart
        • Relationship Map
      • Map Lens
      • Theming
      • User Avatar
    • Global Settings
      • General
      • App Settings
      • Presets
      • Metrics
      • Viewer
      • SAR
        • Importing Data For A SAR
        • SAR Disclosure Document Storage
        • Getting SAR data from Google Vault
        • SAR Configuration Access
        • SAR File Status
      • Disclosure Portal
        • Disclosure Portal Set Up
        • SARs From The Portal
        • Email Delivery Settings
          • Delivery Settings
          • Brand Settings
          • Customise Emails
        • SMS Delivery Settings
        • Requestor Message Limit
        • Attachment Configuration
        • Password Configuration
        • File Scanner Configurator
      • Collections
      • Notifications
      • OData API
  • AI Studio
    • Classifications
      • Classifications
      • Classification Rules
    • Jobs
  • Labels
  • API Guides
    • Insight API Guide
      • Swagger Documentation
      • Trying Some Endpoints
      • Search Filter
      • Hits / Items
      • Inspecting REST Calls
    • Data Science API Guide
      • REST Interface
        • Login
        • Datasets
        • Fields
        • Field Statistics
        • Search
        • Scroll
        • Update
      • Python Library
      • Data Science API Wrapper
        • Login
        • Datasets
        • Fields
        • Field Statistics
        • Search
        • Scroll
        • Scroll Search
        • Update Single Document
        • Bulk Update
      • Search API Wrapper
        • Login
        • Privileged Access
        • Search
        • Collection
        • ChatBot Class
      • Admin API Wrapper
      • AI Model Server API Wrapper
      • Utilities
        • Query Builders
        • Azure Key Vault Wrapper
    • Creating a Native Enrichment Step
      • Creating an Enrichment Step
        • Creating the Core Classes
        • Extending our Enrichment Step
        • Adding a Configuration Template
        • Adding the Enrichment Step
        • Creating an Enrichment Pipeline
      • Other Tasks
        • Entities, Metadata and Data
        • Accessing the Repository
      • Example Code
      • Troubleshooting
    • Creating a Python Enrichment Step
      • Creating an Enrichment Step
        • Running the Example from Command Line
        • Running the Example
      • Creating Your Own Step
      • Adding or Changing Entities, Metadata
  • Whitepapers and Explainers
    • From a Billion To One – Mastering Relevancy
    • Methods for Text Summarization
      • Application
      • Technology Methods
      • Commercial Tools
      • Key Research Centres
      • Productionisation
      • Related Areas of Text Analytics
      • Conclusion
      • References
Powered by GitBook
On this page
  1. API Guides
  2. Data Science API Guide
  3. Search API Wrapper

Collection

PreviousSearchNextChatBot Class

Last updated 3 months ago

CtrlK
  • Get Collection Types
  • Search Collections
  • Get Collection
  • Delete Collection
  • New Collection
  • Add to Collection
  • Add Collection Permissions
  • Get User
  • Get Settings
  • Download
  • Collection Objects
  • Attributes
  • Methods

Get Collection Types

Pulls back all configured collection types as CollectionType objects

SearchAPI.get_collection_types(raw=False) 
Name
Type
Description

raw

boolean

If true, this function returns the JSON response as a dictionary, not a CollectionType object. Default is false.


Search Collections

Searches all collections, returning a list of Collection objects. All matching collection objects up to the max_results parameter (visible to the user) will be returned regardless of page size parameter value.

SearchAPI.search_collections(query_string="*", start_page_num=1, page_size=20, max_results=0, raw=False) 

Get Collection

Used to retrieve a specific collection as a Collection object.

SearchAPI.get_collection(collection_id, raw=False) 
Name
Type
Description

collection_id

string

ID of collection to return

raw

boolean

If true, this function returns the JSON response as a dictionary, not a CollectionType object. Default is false.


Delete Collection

Used to delete a collection by ID.

SearchAPI.delete_collection(collection_id) 
Name
Type
Description

collection_id

string

ID of collection to delete


New Collection

Used to create a new collection, returns the created collection as a Collection object.

SearchAPI.new_collection(name, description="", collection_type="general-collection") 
Name
Type
Description

name

string

Name for new collection

description

string

Optional, description for collection

collection_type

string or CollectionType

Collection type to use, defaults to "general-collection", which will always be available.


Add to Collection

Adds a document to a collection.

SearchAPI.add_to_collection(collection, dataset, document_id) 
Name
Type
Description

collection

string or collection

Collection to add to

dataset

string or dataset

Dataset containing document (either string dataset ID or a Dataset object)

document_id

string

ID of document to add


Add Collection Permissions

Used to add additional user permissions to collections.

SearchAPI.add_collection_permissions(collection, permissions, users)
Name
Type
Description

collection

string or Collection

Collection to add to

permissions

string or integer

“remove”, “read”, “write”, “delete” or appropriate corresponding integer value

users

list of string

List of qualified usernames to add these permissions for


Get User

Used to get details about an AIE user as a SearchUser object.

SearchAPI.get_user(user_id="me", raw=False) 
Name
Type
Description

user_id

string

ID of user to pull (defaults to “me”, which returns the authenticated user)

raw

boolean

If true, this function returns the JSON response as a dictionary, not a SearchUser object. Default is false.


Get Settings

Used to return the Aiimi Insight Engine settings dictionary, which can be used to determine various things about the configured system, including details on search flows, configured DSAR and disclosure settings, theming etc.

SearchAPI.get_settings()

Download

Used to directly download a document from AIE, this is returned in python as a BytesIO object.

SearchAPI.download(dataset, document_id) 
Name
Type
Description

dataset

string or Dataset

Dataset containing document (either string dataset ID or a Dataset object)

document_id

string

ID of document to download


Collection Objects

The Collection class is a Python representation of a collection object, typically obtained through the SearchAPI wrapper. This class provides a structured way to interact with collections, allowing users to manage files, permissions, and other attributes associated with a collection. Below is a detailed overview of each class and its functionality.

Attributes

collectionType An instance of CollectionType, representing the type of the collection.

search_api An optional SearchAPI instance for performing operations.

Methods

type() Returns the type of the collection.

name() Returns the name of the collection.

str() Returns a string representation of the collection in the format collection:<name>.

to_dict() Returns a dictionary representation of the collection, including files, file entries, and permissions.

files() Returns a copy of the list of files associated with the collection.

file_entries() Returns a copy of the file entries associated with the collection.

permissions() Returns a copy of the permissions associated with the collection.

update(search_api=None) Updates the collection's data using the provided search_api instance or the instance stored in the object.

  • Parameters:

    • search_api (optional): An instance of SearchAPI to fetch the latest collection data.

  • Raises:

    • Exception: If no SearchAPI instance is provided.

delete(search_api=None) Deletes the collection using the provided search_api instance or the instance stored in the object.

  • Parameters:

    • search_api (optional): An instance of SearchAPI to perform the deletion.

  • Raises:

    • Exception: If no SearchAPI instance is provided.

add_document(dataset, document_id, search_api=None) Adds a document to the collection.

  • Parameters:

    • dataset: The dataset to which the document belongs. This can be an instance of Dataset or a dataset ID.

    • document_id: The ID of the document to be added.

    • search_api (optional): An instance of SearchAPI to perform the operation.

  • Raises:

    • Exception: If no SearchAPI instance is provided.

  • Notes:

    • If the document is already in the collection, a warning is printed and the operation is not performed again.

add_permissions(permissions, users, search_api=None) Adds permissions for specified users to the collection.

  • Parameters:

    • permissions: The permissions to be added, which can be a string ("read", "write", "delete", or "remove") or an integer.

    • users: A list of users to whom the permissions will be granted.

    • search_api (optional): An instance of SearchAPI to perform the operation.

  • Raises:

    • Exception: If no SearchAPI instance is provided.

    • ValueError: If the permissions are not valid.

  • Notes:

    • The method first removes the specified users from all permission types and then adds them according to the specified permissions.

parse_permissions(permissions) A static method to parse permissions from a string or integer.

  • Parameters:

    • permissions: The permissions to be parsed, which can be a string or an integer.

  • Returns:

    • An integer representing the parsed permissions.

  • Raises:

    • ValueError: If the permissions are not valid.

create_new(search_api, name, description="", collection_type="general-collection") A static method to create a new collection.

  • Parameters:

    • search_api: An instance of SearchAPI to perform the operation.

    • name: The name of the new collection.

    • description (optional): A description for the new collection.

    • collection_type (optional): The type of the collection, defaulting to "general-collection".