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.Open Azure Portal
Sign in to the Azure portal and navigate to your Azure AI Search service
Configure Index
Review the auto-generated index schema. The wizard detects fields and sets appropriate attributes:
HotelId: Document key (required)HotelName: Searchable and retrievableDescription: Searchable with full-text analysisRating: Filterable and sortableLocation: Geospatial point for proximity search
Monitor Indexing Progress
You can monitor the creation and execution of the indexer in real-time.- From the left navigation, select Indexers
- Find
hotels-sample-indexerin the list - Check the Status column:
- In progress: Indexer is currently running
- Success: All documents indexed successfully
- Warning: Some documents had issues but indexing completed
- Total documents indexed
- Number of documents succeeded/failed
- Execution time
View Index Schema
Once indexing completes, examine the index structure:- Select Indexes from the left navigation
- Click on hotels-sample-index
- Select the Fields tab to view the schema
Understanding Field Attributes
| Attribute | Purpose | Example |
|---|---|---|
| key | Unique document identifier | HotelId |
| searchable | Full-text searchable | Description |
| filterable | Can be used in filter expressions | Rating gt 4 |
| sortable | Can be used for ordering results | orderby=Rating desc |
| facetable | Generates facet counts | facets=["Category"] |
| retrievable | Included in search results | All display fields |
Query with Search Explorer
Search Explorer is a built-in query tool in the Azure portal.Basic Text Search
- Navigate to your index
- Select the Search explorer tab
- Enter a search query in the search box:
JSON View for Advanced Queries
For more control, switch to JSON view:- Click View > JSON view
- Enter a JSON query:
search: Full-text query stringselect: Fields to return in resultsfilter: OData filter expressiontop: Maximum results to returncount: Include total count of matches
Query Examples
Filter by Rating
Find highly-rated hotels:Geospatial Search
Find hotels within 5km of a location (Washington D.C.):Boolean Filter
Find hotels with parking included:Fuzzy Search
Handle typos and misspellings:~) operator enables fuzzy matching, so “seatle” matches “Seattle”.
Understanding Results
Search results are returned in JSON format:@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*
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
Using the Mini-Map
For long result sets, Search Explorer provides a mini-map:- Look for the mini-map on the right side of results
- Click on any section to jump directly to that part of the output
- Useful for navigating large JSON responses
Add or Modify Fields
You can extend your index with new fields:- Go to the Fields tab
- Click Add field
- Specify:
- Field name
- Data type (Edm.String, Edm.Int32, etc.)
- Attributes (searchable, filterable, etc.)
Best Practices
Query Performance
Query Performance
- Use
selectto return only needed fields - Apply filters before sorting for better performance
- Use
topto limit result set size - Consider caching frequently used queries
Field Design
Field Design
- 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
Query Tuning
Query Tuning
- 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:- Navigate to the resource group
- Select Delete resource group
- 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