π Introduction: Why Azure AI Search Exists
Modern companies accumulate massive amounts of information:
- internal documents
- PDFs, Word, PowerPoint
- emails
- SQL databases
- support tickets
- knowledge bases
- website content
- logs
- product data
The real challenge is finding the right information at the right moment.
Traditional search systems (SQL LIKE, Elasticsearch, SharePoint Search…) rely on:
- exact keywords
- literal matching
- rigid filters
- no semantic understanding
But users want to ask natural questions like:
“Which hotels in New York allow pets and have a gym”
“Show me internal documents about migrating to Azure”
“What incidents are similar to yesterday’s outage”
This is where Azure AI Search becomes essential.
π Azure AI Search: The Modern Search Engine for Enterprise AI
Azure AI Search is a fully managed cloud search engine designed to:
- index structured and unstructured data
- perform full‑text search (like Elasticsearch)
- perform vector search (like Pinecone)
- combine both with hybrid search
- use semantic ranking to understand meaning
- integrate seamlessly into RAG (Retrieval‑Augmented Generation) systems
It is a core building block for modern AI architectures.
π§© How Azure AI Search Fits Into a Retrieval Augmented Generation System
A typical RAG pipeline has four components:
Ingestion
Collect documents (PDFs, emails, websites, databases…).Indexing
Azure AI Search transforms them into:- searchable text
- structured fields
- vector embeddings
- filterable metadata
Retrieval
When a user asks a question, Azure AI Search:- matches keywords
- understands meaning (semantic search)
- compares vectors
- returns the most relevant passages
Generation
Azure OpenAI (or another LLM) uses these passages to produce a grounded, accurate answer.
Azure AI Search is therefore the retrieval brain of the entire system.
π️ Let's Start With a Simple Example
In this simple tutorial, we will:
- create an Azure AI Search Service
- Create a Storage Account and store a jsonl file in a container
- Import the json file data into the Azure AI Search Service
- Perform requests using the Azure Search Service
π§± Step 1 — Create an Azure AI Search Service
- Go to the Subscription where you want to create your Azure AI Service Search → Create a resource
- Resource: Azure AI Search
- Region: choose one close to you
- Pricing tier: Free (F1)
- Create the service
This will be your search engine.
π¦ Step 2 — Create a Storage Account and Upload a Simple JSONL File
- Create a Storage Account
- Go to Containers, Click "Storage Browser" in the left pane, then, Blob Containers in the left menu of the landing page, or the square for Blob Containers.
- Create a container named
aisearchdata - Upload a file named
hotels.jsonl:
{"hotelId":"1","name":"Hotel Azure","city":"Paris","rating":4.5,"price":180,"amenities":["wifi","gym","spa"],"description":"A modern hotel close to the city center with excellent connectivity."}
{"hotelId":"2","name":"Cloud Inn","city":"London","rating":3.8,"price":120,"amenities":["wifi"],"description":"Affordable hotel hotelIdeal for business travelers."}
{"hotelId":"3","name":"AI Suites","city":"Paris","rating":5.0,"price":320,"amenities":["wifi","spa","pool"],"description":"Luxury suites with premium services and AI-powered concierge."}
⚠️ Important — Do not name your key field id when using the “Keyword search” wizard.
The wizard automatically creates a system id field (non-editable) from blob metadata.
If your JSON also contains an id field, Azure will throw “Target field name must be unique”.
Use a different name instead, such as hotelId, documentId, etc.
Then, upload the file into the previously created blob container.
π️ Step 3 — Create a Simple Index in Azure AI Search
In your Search service → Import data (new)
Go back to your Azure AI Search Service and click "Import Data (new)Source: Azure Blob Storage
Select Azure Blob Storage
then select Keyword.
You will find your Storage Account, blob container references in the drop down menu. Choose Json Lines as a format.
Field configuration:
Then, pass the pages Apply AI Enrichment, and you land on the "Preview Index Fields" page: Now, for each field, we have to set the field types.
π§ Understanding Each Field Type
π 1. key — Unique Identifier
| Field | Purpose |
|---|---|
id | Unique identifier. Required. Only one field can be key=true. |
id, indexing is impossible.π 2. searchable — Full‑Text Search
| Field | Why |
|---|---|
name | Allows searching for “Azure”, “Cloud”, etc. |
description | Long text, ideal for full‑text search. |
π€ 3. retrievable — Returned in Results
These fields appear in the search response:
- name
- city
- price
- rating
- amenities
- description
retrievable=false, the field can still be filtered or sorted but will not appear in results.π 4. filterable — Used in Filters
| Field | Why |
|---|---|
city | Filter by city. |
price | Filter by price. |
rating | Filter by rating. |
amenities | Filter by “wifi”, “spa”, etc. |
π 5. facetable — For UI Facets
| Field | Why |
|---|---|
city | Show “Paris (2), London (1)” |
amenities | Show “wifi (3), spa (2), pool (1)” |
rating | Group by rating |
↕️ 6. sortable — Sorting Results
| Field | Why |
|---|---|
price | Sort from cheapest to most expensive. |
rating | Sort from highest to lowest rating. |
π§± Summary
Each field type plays a specific role:
- searchable: used to understand the query
- filterable: used to restrict results
- sortable: used to order results
- facetable: used to build dynamic filters
- retrievable: returned in the response
- key: unique identifier
Setting the fields for our example
π id
| Property | Value | Why |
|---|---|---|
| key | ✔️ | Required unique identifier. |
| searchable | ❌ | Not text to analyze. |
| filterable | ✔️ | Useful to retrieve a specific document. |
| sortable | ❌ | No business value sorting by id. |
| facetable | ❌ | Not relevant for grouping. |
| retrievable | ✔️ | Returned in results. |
π¨ name
| Property | Value | Why |
|---|---|---|
| searchable | ✔️ | Allows searching “Azure”, “Cloud”… |
| filterable | ❌ | Not used for filtering. |
| sortable | ❌ | No meaningful sorting. |
| facetable | ❌ | Not useful. |
| retrievable | ✔️ | Displayed in results. |
π city
| Property | Value | Why |
|---|---|---|
| searchable | ❌ | No linguistic analysis needed. |
| filterable | ✔️ | Filter by city. |
| sortable | ✔️ | Sort by city. |
| facetable | ✔️ | Create facets “Paris (2)”. |
| retrievable | ✔️ | Displayed in results. |
⭐ rating
| Property | Value | Why |
|---|---|---|
| searchable | ❌ | Not text. |
| filterable | ✔️ | Filter by rating. |
| sortable | ✔️ | Sort highest to lowest. |
| facetable | ✔️ | Group by rating. |
| retrievable | ✔️ | Displayed in results. |
πΆ price
| Property | Value | Why |
|---|---|---|
| searchable | ❌ | Not text. |
| filterable | ✔️ | Filter by price. |
| sortable | ✔️ | Sort low to high. |
| facetable | ✔️ | Create price ranges. |
| retrievable | ✔️ | Displayed in results. |
π️ amenities
| Property | Value | Why |
|---|---|---|
| searchable | ❌ | These are tags, not free text. |
| filterable | ✔️ | Filter by “wifi”, “spa”… |
| sortable | ❌ | Not meaningful. |
| facetable | ✔️ | Create facets “wifi (3)”. |
| retrievable | ✔️ | Displayed in results. |
π description
| Property | Value | Why |
|---|---|---|
| searchable | ✔️ | Long text → ideal for full‑text search. |
| filterable | ❌ | Not used for filtering. |
| sortable | ❌ | No meaningful sorting. |
| facetable | ❌ | Not useful. |
| retrievable | ✔️ | Displayed in results. |





































No comments:
Post a Comment