In our previous articles related to Azure Search Service, we have learned the following.
- Azure Search as a Service – What is Azure Search as a Service along with its features and advantages
- Creating Azure Search Service and Scaling Replicas and Partitions – How to create Azure Search Service and its capacity features.
- Azure Search Service Create Index
In this article, we will discuss about the methods supported as of this writing to load data into the Azure Search Indexes.
Currently, there are two ways in which you could upload your application specific data to the Azure Search Index.
- Push data to Azure Search Index
- Pull data from a data source and insert data into Azure Search Index
Method1: Push data to Azure Search index
As of this writing, you can push your data into Azure Index only through .NET SDK or REST API provided by Microsoft Azure.
- Prepare your Index Schema on Azure Search Service
- Prepare your Application specific data in the format that Azure Search expects. It’s optional that your Application data source type is compatible with Azure Search. Azure Search need not be aware of your application data source.
- Get the Search Service Admin Keys
- Use .NET SDK or REST API to do Bulk Inserts of the data that you have prepared in the 2nd step to Azure Search Index
Other important notes about this Push method:
- You can push either a single document or bulk documents.
- for Bulk Inserts, you can only push 1000 documents at a time
- The maximum size that you can bulk insert at a time is 16 MB
This is the most flexible way to push data to your Azure Search Index as you would be preparing the data as per the .NET SDK or the REST API expects irrespective of where your application data is stored.
Method2: Pull data from a data source and insert data into Azure Search Index
As of this writing, this option automatically crawls the data from the following data sources.
- Azure SQL Database
- SQL Server on Azure VMs
- Azure Document DB
- Azure Blob Storage (Preview as of this writing)
- Azure Table Storage (Preview as of this writing)
In this method, we don’t need to pass any data to Azure Search. We just need to connect these Data Sources to Azure Search. We would discuss about this method in detail in the upcoming articles.
Summary: in this article, we have learned about the methods that are available currently for populating the data to the Azure Search Index.
- Push Method using .NET SDK / REST API
- Pull method using Indexers.
Hope you enjoyed reading the article. Your feedback is appreciated.
How would you show different results for internal and external users using azure search for searching documents? And would you embed the metadata like this doc is for internal users only and they can only be able to view not download etc etc
You can push data to search index by using Azure Data Factory (ADF).