PHPackages                             b3n/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. [Search &amp; Filtering](/categories/search)
4. /
5. b3n/php-azure-search

Abandoned → [benjaminhirsch/php-azure-search](/?search=benjaminhirsch%2Fphp-azure-search)ArchivedLibrary[Search &amp; Filtering](/categories/search)

b3n/php-azure-search
====================

A simple PHP Class to communicate with the Microsoft Azure Search REST API

0.9.2(7y ago)115.0k7[5 issues](https://github.com/benjaminhirsch/azure-search-php/issues)[2 PRs](https://github.com/benjaminhirsch/azure-search-php/pulls)MITPHPPHP ^7.0

Since Mar 31Pushed 3y agoCompare

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

READMEChangelog (6)Dependencies (5)Versions (7)Used By (0)

❗This package is no longer maintained due to missing time and personal relevance ❗
==================================================================================

[](#this-package-is-no-longer-maintained-due-to-missing-time-and-personal-relevance-)

Microsoft Azure Search Service for php
--------------------------------------

[](#microsoft-azure-search-service-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/17b5e14315fc459122f5bd8ea35a2bd6024142a6f6ccec2f04a772b33f0bef2b/68747470733a2f2f706f7365722e707567782e6f72672f62656e6a616d696e6869727363682f7068702d617a7572652d7365617263682f762f737461626c65)](https://packagist.org/packages/benjaminhirsch/php-azure-search)[![Build Status](https://camo.githubusercontent.com/fed5b20bfde13e16176a6c8ff588fc63ac64b6b12ee3dd51190602d37d502b9e/68747470733a2f2f62656e6a616d696e6869727363682e76697375616c73747564696f2e636f6d2f617a7572652d7365617263682d7068702f5f617069732f6275696c642f7374617475732f62656e6a616d696e6869727363682e617a7572652d7365617263682d706870)](https://benjaminhirsch.visualstudio.com/azure-search-php/_build/latest?definitionId=1)[![Build Status](https://camo.githubusercontent.com/24d5d4bd75d75672de17c9ec1a0376087fb3954ce7a4fe8ee2ab68043ca1223f/68747470733a2f2f7472617669732d63692e636f6d2f62656e6a616d696e6869727363682f617a7572652d7365617263682d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/benjaminhirsch/azure-search-php)[![Coverage Status](https://camo.githubusercontent.com/212baf2d7b826e8905e11a76516a72e183bc191d8ee00d0d2618b65e34a772e0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f62656e6a616d696e6869727363682f617a7572652d7365617263682d7068702f62616467652e7376673f6272616e63683d6d617374657226743d31)](https://coveralls.io/github/benjaminhirsch/azure-search-php?branch=master)[![License](https://camo.githubusercontent.com/fd5ad01b333e812b852f21c06b1a9fa8e61429e2abedbc313aa04821303f6ee7/68747470733a2f2f706f7365722e707567782e6f72672f62656e6a616d696e6869727363682f7068702d617a7572652d7365617263682f6c6963656e7365)](https://packagist.org/packages/benjaminhirsch/php-azure-search)

`benjaminhirsch/php-azure-search` is a simple php toolbox to interact with the Microsoft Azure Search Service REST API.

**Features:**

- Create, update and delete indexes including suggesters and corsOptions
- Create, update and delete all type of fields including collections
- List indexes
- Get index statistics
- Add, update and delete documents
- Search documents
- Get live suggestions
- Count documents

**Upcomming Features**

- Add scoring profiles

Installation
------------

[](#installation)

The easiest way to get started is to install `benjaminhirsch/php-azure-search` via composer.

```
$ composer require benjaminhirsch/php-azure-search
```

---

### Initalize

[](#initalize)

You get your credentials `$azure_url`, `$azure_admin_key` and `$azure_version` in your Microsoft Azure portal under "Search Services".

```
$azuresearch = new BenjaminHirsch\Azure\Search\Service(azure_url, azure_admin_key, azure_version);
```

### Create a Index

[](#create-a-index)

At first you have to create a index `BenjaminHirsch\Azure\Search\Index` in which you have to store your documents later. Your index can be filled with as many fields as you want. Adding a suggester is optional but required if you want to use live search (suggestions).

```
$index = new BenjaminHirsch\Azure\Search\Index('name of your index');
$index->addField(new BenjaminHirsch\Azure\Search\Index\Field('field name 1', BenjaminHirsch\Azure\Search\Index\Field::TYPE_STRING, true))
       ->addField(new BenjaminHirsch\Azure\Search\Index\Field('field name 2', BenjaminHirsch\Azure\Search\Index\Field::TYPE_STRING))
       ->addSuggesters(new BenjaminHirsch\Azure\Search\Index\Suggest('livesearch', ['field name(s)']));

$azuresearch->createIndex($index);
```

### Delete a index

[](#delete-a-index)

Deletes the complete index from Azure. Deleting a index also deletes the documents stored in the index.

```
$azuresearch->deleteIndex('name of the index to delete');
```

### Upload documents

[](#upload-documents)

After you have created a index, you are ready to fill the index with your data. Maximum array size per request (1000).

```
$data['value'][] = [
    '@search.action' => BenjaminHirsch\Azure\Search\Index::ACTION_UPLOAD,
    'field name 1' => ,
    'field name 2' =>
];

$azuresearch->uploadToIndex('name of your index', $data);
```

### Live search (suggestions)

[](#live-search-suggestions)

```
$azuresearch->suggestions('name of your index', 'your term', 'livesearch')
```

### Search documents

[](#search-documents)

```
$azuresearch->search('name of your index', 'your term');
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.9% 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.

###  Release Activity

Cadence

Every ~187 days

Recently: every ~225 days

Total

6

Last Release

2760d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5e21a9a4fa452bdd6e0bf55ddd46913bba1962638ff4ed26e9c6fd0048808b9?d=identicon)[benjaminhirsch](/maintainers/benjaminhirsch)

---

Top Contributors

[![benjaminhirsch](https://avatars.githubusercontent.com/u/2293943?v=4)](https://github.com/benjaminhirsch "benjaminhirsch (37 commits)")[![azure-pipelines[bot]](https://avatars.githubusercontent.com/in/9426?v=4)](https://github.com/azure-pipelines[bot] "azure-pipelines[bot] (1 commits)")[![davidohlin](https://avatars.githubusercontent.com/u/864179?v=4)](https://github.com/davidohlin "davidohlin (1 commits)")

---

Tags

azureazure-searchlivesearchphprestsearchsearchmicrosoftazure

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[elasticsearch/elasticsearch

PHP Client for Elasticsearch

5.3k178.3M943](/packages/elasticsearch-elasticsearch)[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[solarium/solarium

PHP Solr client

93432.7M98](/packages/solarium-solarium)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15224.3M65](/packages/opensearch-project-opensearch-php)

PHPackages © 2026

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