Here are some more details about these requirements:
- The endpoint and API key for Azure AI Search. Create an endpoint and API key.
-
The name of the index in Azure AI Search. Create an index.
The Azure AI Search index that you use must have an index schema that is compatible with the schema of the documents that Unstructured produces for you. Unstructured cannot provide a schema that is guaranteed to work in all circumstances. This is because these schemas will vary based on your source files’ types; how you want Unstructured to partition, chunk, and generate embeddings; any custom post-processing code that you run; and other factors. You can adapt the following index schema example for your own needs. Be sure to replace
<number-of-dimensions>(in three locations in the following example) with the number of dimensions of the embedding model you are using:Therecord_id,element_id, andidfields are closely related, but each has a distinct purpose. Therecord_ididentifies the source document.- For S3 and Azure Blob connectors, the record ID is a Version 5 UUID generated from the namespace and file path of the document. This ensures that the ID is deterministic and unique at the file level.
- For all other blob connectors, the record ID is a Version 4 UUID representing a random 32-character hexadecimal string.
- For SQL connectors, the record ID is generated from the table name and record ID of the database table.
element_ididentifies the specific element. Source connectors generate element ID in one of the following ways, depending on the source connector:- A SHA-256 hash of the element’s text, its position on the page, the page number it’s on, and the name of the related file. This is to ensure that the ID is deterministic and unique at the file level.
- A Version 4 UUID generated using random numbers.
Each element from the same document contains that document’s record ID; this enables Unstructured to identify all the elements generated from a given document. If a source connector has been set to not reprocess all documents each time a workflow runs, Unstructured uses the record ID (along with the record version) to determine which documents are unchanged and should not be processed again. TheOlder connectors generate SHA-256 hashes for element IDs, while more modern connectors generate UUIDs. Going forward, older connectors will be converted to using UUIDs as well.idrepresents the actual row that Unstructured writes into the destination location. The ID is a Version 5 UUID generated from the namespace, element ID and record ID of the source document. The ID is deterministic and unique at the row level. Destination connectors process document updates in one of the following ways, depending on the connector:- Use the record ID to identify and delete all elements from a given document, prior to writing new elements from that document into the destination.
- Use the ID to perform upsert operations without generating duplicate rows, ensuring that reprocessing documents is idempotent.
CLI, Python
AZURE_SEARCH_ENDPOINT- The endpoint URL for Azure AI Search, represented by--endpoint(CLI) orendpoint(Python).AZURE_SEARCH_API_KEY- The API key for Azure AI Search, represented by--key(CLI) orkey(Python).AZURE_SEARCH_INDEX- The name of the index for Azure AI Search, represented by--index(CLI) orindex(Python).
--partition-by-api option (CLI) or partition_by_api (Python) parameter to specify where files are processed:
-
To do local file processing, omit
--partition-by-api(CLI) orpartition_by_api(Python), or explicitly specifypartition_by_api=False(Python). Local file processing does not use an Unstructured API key or API URL, so you can also omit the following, if they appear:--api-key $UNSTRUCTURED_API_KEY(CLI) orapi_key=os.getenv("UNSTRUCTURED_API_KEY")(Python)--partition-endpoint $UNSTRUCTURED_API_URL(CLI) orpartition_endpoint=os.getenv("UNSTRUCTURED_API_URL")(Python)- The environment variables
UNSTRUCTURED_API_KEYandUNSTRUCTURED_API_URL
-
To send files to the legacy Unstructured Partition Endpoint for processing, specify
--partition-by-api(CLI) orpartition_by_api=True(Python). Unstructured also requires an Unstructured API key and API URL, by adding the following:--api-key $UNSTRUCTURED_API_KEY(CLI) orapi_key=os.getenv("UNSTRUCTURED_API_KEY")(Python)--partition-endpoint $UNSTRUCTURED_API_URL(CLI) orpartition_endpoint=os.getenv("UNSTRUCTURED_API_URL")(Python)- The environment variables
UNSTRUCTURED_API_KEYandUNSTRUCTURED_API_URL, representing your API key and API URL, respectively.
You must specify the API URL only if you are not using the default API URL for Unstructured Ingest, which applies to Let’s Go, Pay-As-You-Go, and Business SaaS accounts.The default API URL for Unstructured Ingest ishttps://api.unstructuredapp.io/general/v0/general, which is the API URL for the legacyUnstructured Partition Endpoint. However, you should always use the URL that was provided to you when your Unstructured account was created. If you do not have this URL, email Unstructured Support at support@unstructured.io.If you do not have an API key, get one now.If you are using a Business account, the process for generating Unstructured API keys, and the Unstructured API URL that you use, are different. For instructions, see your Unstructured account administrator, or email Unstructured Support at support@unstructured.io.

