Skip to main content

Quickstart: Full-Text Search in Azure AI Search

This quickstart shows you how to create your first search index using the Azure portal. You’ll learn how to:
  • Create a search index with sample hotel data
  • Load data into the index
  • Query the index using Search Explorer
  • View and analyze search results

Prerequisites

  • An Azure subscription
  • An Azure AI Search service (any tier)
  • A web browser to access the Azure portal

Create an Index with Sample Data

The quickest way to get started is using the Azure portal with built-in sample data.
1

Open Azure Portal

Sign in to the Azure portal and navigate to your Azure AI Search service
2

Start Import Wizard

From the service dashboard, select Import data to launch the data import wizard
3

Connect to Sample Data

Choose Samples as the data source and select the hotels-sample dataset
4

Configure Index

Review the auto-generated index schema. The wizard detects fields and sets appropriate attributes:
  • HotelId: Document key (required)
  • HotelName: Searchable and retrievable
  • Description: Searchable with full-text analysis
  • Rating: Filterable and sortable
  • Location: Geospatial point for proximity search
5

Create Indexer

Name your indexer hotels-sample-indexer and run it once to load the data

Monitor Indexing Progress

You can monitor the creation and execution of the indexer in real-time.
  1. From the left navigation, select Indexers
  2. Find hotels-sample-indexer in the list
  3. Check the Status column:
    • In progress: Indexer is currently running
    • Success: All documents indexed successfully
    • Warning: Some documents had issues but indexing completed
The status page shows:
  • Total documents indexed
  • Number of documents succeeded/failed
  • Execution time

View Index Schema

Once indexing completes, examine the index structure:
  1. Select Indexes from the left navigation
  2. Click on hotels-sample-index
  3. Select the Fields tab to view the schema

Understanding Field Attributes

AttributePurposeExample
keyUnique document identifierHotelId
searchableFull-text searchableDescription
filterableCan be used in filter expressionsRating gt 4
sortableCan be used for ordering resultsorderby=Rating desc
facetableGenerates facet countsfacets=["Category"]
retrievableIncluded in search resultsAll display fields

Query with Search Explorer

Search Explorer is a built-in query tool in the Azure portal.
  1. Navigate to your index
  2. Select the Search explorer tab
  3. Enter a search query in the search box:
beach OR spa
This returns all documents containing either “beach” or “spa” in searchable fields.

JSON View for Advanced Queries

For more control, switch to JSON view:
  1. Click View > JSON view
  2. Enter a JSON query:
{
    "search": "beach OR spa",
    "select": "HotelId, HotelName, Description, Rating",
    "filter": "Rating gt 4",
    "top": 10,
    "count": true
}
Query parameters explained:
  • search: Full-text query string
  • select: Fields to return in results
  • filter: OData filter expression
  • top: Maximum results to return
  • count: Include total count of matches

Query Examples

Filter by Rating

Find highly-rated hotels:
{
    "search": "*",
    "filter": "Rating gt 4",
    "orderby": "Rating desc"
}
Find hotels within 5km of a location (Washington D.C.):
{
    "search": "*",
    "filter": "geo.distance(Location, geography'POINT(-77.03241 38.90166)') le 5",
    "select": "HotelName, Address/City"
}

Boolean Filter

Find hotels with parking included:
{
    "search": "beach",
    "filter": "ParkingIncluded eq true",
    "count": true
}
Handle typos and misspellings:
{
    "queryType": "full",
    "search": "seatle~",
    "select": "HotelName, Address/City"
}
The tilde (~) operator enables fuzzy matching, so “seatle” matches “Seattle”.

Understanding Results

Search results are returned in JSON format:
{
    "@odata.count": 3,
    "value": [
        {
            "@search.score": 0.8,
            "HotelId": "1",
            "HotelName": "Ocean View Resort",
            "Description": "Beautiful beachfront hotel with spa services",
            "Rating": 4.5
        }
    ]
}
Response structure:
  • @odata.count: Total number of matching documents
  • @search.score: Relevance score (higher is better)
  • value: Array of matching documents

Query Syntax Options

Azure AI Search supports two query syntaxes:

Simple Syntax (Default)

  • Intuitive, familiar syntax
  • Boolean operators: AND, OR, NOT
  • Phrase search: "exact phrase"
  • Prefix search: hotel*
Example:
ocean view AND spa -airport

Full Lucene Syntax

Enable with "queryType": "full"
  • Fuzzy search: seattle~
  • Proximity search: "ocean view"~5
  • Term boosting: luxury^2 hotel
  • Regular expressions: /[mh]otel/
  • Fielded search: HotelName:ocean
Example:
{
    "queryType": "full",
    "search": "HotelName:luxury^2 OR Description:beachfront"
}

Using the Mini-Map

For long result sets, Search Explorer provides a mini-map:
  1. Look for the mini-map on the right side of results
  2. Click on any section to jump directly to that part of the output
  3. Useful for navigating large JSON responses

Add or Modify Fields

You can extend your index with new fields:
  1. Go to the Fields tab
  2. Click Add field
  3. Specify:
    • Field name
    • Data type (Edm.String, Edm.Int32, etc.)
    • Attributes (searchable, filterable, etc.)
Existing fields cannot be modified once created. To change existing fields, you must create a new index and reload the data.

Best Practices

  • Use select to return only needed fields
  • Apply filters before sorting for better performance
  • Use top to limit result set size
  • Consider caching frequently used queries
  • Make fields searchable only if needed for full-text search
  • Use filterable for metadata and categorical data
  • Set sortable only on fields that need ordering
  • Mark key fields and internal IDs as non-searchable
  • Use simple syntax for user-facing search boxes
  • Reserve full Lucene syntax for advanced users
  • Test queries with representative data
  • Monitor query performance with metrics

Clean Up Resources

If you created a search service specifically for this quickstart:
  1. Navigate to the resource group
  2. Select Delete resource group
  3. Confirm deletion
Free tier search services (one per subscription) don’t incur charges and don’t need to be deleted unless you want to create another free service.

Next Steps

Vector Search

Learn about semantic similarity search with embeddings

Create an Index

Build a production-ready index with your own data

Query Syntax

Master full-text query syntax and operators

Hybrid Search

Combine text and vector search for best results

Build docs developers (and LLMs) love