PHPackages                             crassaert/php-azure-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. crassaert/php-azure-search

ActiveLibrary[API Development](/categories/api)

crassaert/php-azure-search
==========================

PHP wrapper to query Microsoft Azure Search REST API

22.4kPHP

Since Nov 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/crassaert/php-azure-search)[ Packagist](https://packagist.org/packages/crassaert/php-azure-search)[ RSS](/packages/crassaert-php-azure-search/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

php-azure-search-indexer
========================

[](#php-azure-search-indexer)

PHP wrapper to query Microsoft Azure Search REST API by Cédric Rassaert.

It's strongly recommended to have a Microsoft SQL Server or Azure DocumentDB as data source.

Basic Usage
===========

[](#basic-usage)

New search instance :

`$search = new AzureSearch(AZURE_SEARCH_HOST, AZURE_SEARCH_KEY);`

with :

```
AZURE_SEARCH_HOST = https://[service name].search.windows.net
AZURE_SEARCH_KEY = Admin key provided by Azure

```

Add a datasource
----------------

[](#add-a-datasource)

Feel free to use your Microsoft SQL or DocumentDB host.

```
$search->getSourceRequest()->createSource('actions',
			array('name' => 'my_source',
				  'type' => 'documentdb', // azuresql or documentdb
				  'credentials' => array('connectionString' => AZURE_DB_CONNECT_STRING),
				  'container' => array('name' => AZURE_DB_CONTAINER_NAME)));

```

Add an index
------------

[](#add-an-index)

You can add many fields into your index

```
$fields = array();
$fields[] = array('name' => 'id', 'type' => 'Edm.String', 'key' => true);
$fields[] = array('name' => 'name', 'type' => 'Edm.String', 'key' => false);

$search->getIndexRequest()->createIndex('my_index',
			array('name' => 'my_index',
			'fields' => $fields));

```

Add an indexer
--------------

[](#add-an-indexer)

```
$search->getIndexerRequest()->updateIndexer('actions',
			array(
				'name' => 'actions',
				'dataSourceName' => 'my_source',
				'targetIndexName' => 'my_index',
				'schedule' => array('interval' => 'PT30M',
									'startTime' => date('c')
									)
				));

```

Searching
---------

[](#searching)

```
$data = $search->getDocumentRequest()->searchDocument('my_index',
			array(
				'search' => 'my search string'
				)
			);

```

You can find all options on [Microsoft Azure Website](https://msdn.microsoft.com/fr-fr/library/azure/dn798935.aspx)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4562b49a0e91521dbace4dd691fd68b4a928c7edc1616acd67a5f66d125aaa95?d=identicon)[crassaert](/maintainers/crassaert)

---

Top Contributors

[![crassaert](https://avatars.githubusercontent.com/u/6930172?v=4)](https://github.com/crassaert "crassaert (9 commits)")

### Embed Badge

![Health badge](/badges/crassaert-php-azure-search/health.svg)

```
[![Health](https://phpackages.com/badges/crassaert-php-azure-search/health.svg)](https://phpackages.com/packages/crassaert-php-azure-search)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
