Sunday, February 26, 2017

Azure Search #2–Creating Search Service


Let’s see how we can create a azure search service and how we can manage and scale it.

Step 1: Select Search service from add new

Log in to Azure portal

Click New –> Web & Mobile

Under that select Azure Search .


Step 2: Give a name & select pricing tier

after selecting the Azure Search you will get the following blade.

enter the name you need to use for the search service.


then you have to select the pricing tier, by clicking on Pricing tier option in the blade.


when selecting pricing tier you need to identify your application requirements and select it. Anyway it is always better you start with a lower tier and scale it up when the application need varies. Azure provides you the facility of scaling up or down the tier based on you need. Then click create search service will be created for you.

Pricing Tiers

mainly contains 3 categories.


multi-tenant shared service


provides dedicated computing resources for production workloads at a smaller scale


runs on dedicated machines, with more storage and processing capacity at every level, including the minimum configuration

each category will have sub categories as well with different level of resources. so you can choose it based on your application requirement.Under each category you might see this following terms.

1. Replicas

Instances of the search service, used primarily to load balance query operations. Each replica always hosts one copy of an index. If you have 12 replicas, you will have 12 copies of every index loaded on the service.

By adding more replicas you can get High availability of your search service. It is generally recommend that you start with one partition and one or two replicas, and then scale up as query volumes build.

General recommendations for high availability are:

  • Two replicas for high availability of read-only workloads (queries)
  • Three or more replicas for high availability of read/write workloads (queries plus indexing as individual documents are added, updated, or deleted)

2. partitions

A partition is a mechanism for splitting your data across extra resources. For this reason, when you add a second partition, your data gets split into two. A third partition splits your index into three.


Step 3: Scale Up your service

Go to your search service. There you will see Scale Up option. once you select it you will get the following blade. In that blade you can change the Replicas & Partitions for the search service


In my next post I will discuss what is azure index is. Until that…..


Happy Coding !!!!

Saturday, February 25, 2017

Azure Search #3 - Azure Search Index


When you want to have Azure Search integrated with your application data first thing you have to do is creating a Azure Search index under your search service. One Search service can contain multiple indexes.

An index is a persistent store of documents and other constructs used by an Azure Search service.

A document is a single unit searchable data in your index.

Index is like a table in SQL database. But there are some differences. When creating a index a given data field has set of attributes and a field type. Lets first look at what are the possible data types we can store in Azure search index.


Type Description

Text that can optionally be tokenized for full-text search


A list of strings that can optionally be tokenized for full-text search


Contains true/false values


32-bit integer values


64-bit integer values


Double-precision numeric data


Date time values represented in the OData V4 format


A point representing a geographic location on the globe

for more details about search index datatypes visit here

Next you have to define the attributes, which is used to describe the fields to the azure search service. following are the attributes included in a given data field. if value is not defined it is default set to false.


Attribute Description

A string that provides the unique ID of each document, used for document look up. Every index must have one key. Only one field can be the key, and its type must be set to Edm.String.

Retrievable Specifies whether a field can be returned in a search result
Filterable Allows the field to be used in filter queries
Sortable Allows a query to sort search results using this field
Facetable Allows a field to be used in a faceted navigation structure for user self-directed filtering. Typically fields containing repetitive values that you can use to group multiple documents together (for example, multiple documents that fall under a single brand or service category) work best as facets
Searchable Marks the field as full-text searchable


for an example if you mark some data fields are “Searchable” true when you send a full text search request to the search service, search service will search that text in every field that you have marked “Searchable” and will send the search results for you.

So you can see how easy it is , If we had to make a search service we will have to write a query which will check match in every column which needs to search. but here what you need to do is just mark the field as “Searchable” and search service will do the rest for you.

There are 3 ways to create a Search service Index.

  1. Azure Portal
  2. .Net
  3. Rest API

I will describe then one by one with samples in next blog posts. Until then

Happy Coding !!