PHPackages                             flapjackhq/flapjack-search-php - 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. flapjackhq/flapjack-search-php

ActiveLibrary[API Development](/categories/api)

flapjackhq/flapjack-search-php
==============================

A fully-featured and blazing-fast PHP API client to interact with Flapjack Search. Drop-in replacement for algoliasearch-client-php.

0108PHP

Since Feb 10Pushed 2mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Flapjack Search PHP SDK
=======================

[](#flapjack-search-php-sdk)

A fully-featured and blazing-fast PHP API client for [Flapjack Search](https://github.com/flapjackhq). Drop-in replacement for the Algolia PHP client.

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

[](#installation)

```
composer require flapjackhq/flapjack-search-php:0.1.0-beta.1
```

Quick Start
-----------

[](#quick-start)

```
use Flapjack\FlapjackSearch\Api\SearchClient;
use Flapjack\FlapjackSearch\Configuration\SearchConfig;

// Flapjack Cloud
$client = SearchClient::create('YOUR_APP_ID', 'YOUR_API_KEY');

// Self-hosted Flapjack
$config = SearchConfig::create('YOUR_APP_ID', 'YOUR_API_KEY');
$config->setFullHosts([
    ['url' => 'localhost:7700', 'accept' => 3, 'protocol' => 'http'],
]);
$client = SearchClient::createWithConfig($config);
```

Usage
-----

[](#usage)

### Index Objects

[](#index-objects)

```
$objects = [
    ['objectID' => '1', 'name' => 'iPhone 15', 'brand' => 'Apple', 'price' => 999],
    ['objectID' => '2', 'name' => 'Galaxy S24', 'brand' => 'Samsung', 'price' => 799],
];

$response = $client->saveObjects('products', $objects);
```

### Search

[](#search)

```
// Basic search
$response = $client->search([
    'requests' => [
        ['indexName' => 'products', 'query' => 'iphone'],
    ],
]);

// Search with filters and facets
$response = $client->search([
    'requests' => [
        [
            'indexName' => 'products',
            'query' => 'phone',
            'filters' => 'brand:Apple',
            'facets' => ['brand', 'category'],
        ],
    ],
]);
```

### Manage Settings

[](#manage-settings)

```
$client->setSettings('products', [
    'searchableAttributes' => ['name', 'brand', 'category'],
    'attributesForFaceting' => ['brand', 'category', 'price'],
]);

$settings = $client->getSettings('products');
```

### Synonyms

[](#synonyms)

```
$client->saveSynonym('products', 'syn1', [
    'objectID' => 'syn1',
    'type' => 'synonym',
    'synonyms' => ['phone', 'mobile', 'cell'],
], true);
```

### Rules

[](#rules)

```
$client->saveRule('products', 'rule1', [
    'objectID' => 'rule1',
    'condition' => ['pattern' => 'budget', 'anchoring' => 'contains'],
    'consequence' => ['params' => ['filters' => 'price < 500']],
], true);
```

Environment Variables
---------------------

[](#environment-variables)

The SDK checks for credentials in this order:

1. Constructor parameters
2. `FLAPJACK_APP_ID` / `FLAPJACK_API_KEY`
3. `ALGOLIA_APP_ID` / `ALGOLIA_API_KEY` (backward compatibility)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1 (except 8.3.0)
- ext-curl
- ext-json
- ext-mbstring

Migration from Algolia
----------------------

[](#migration-from-algolia)

See [MIGRATION.md](MIGRATION.md) for a step-by-step guide to migrate from the Algolia PHP SDK.

Contributing
------------

[](#contributing)

This repository hosts the generated Flapjack API client for PHP. To contribute, head over to the [SDK Automation repository](https://github.com/flapjackhq/sdk-automation).

License
-------

[](#license)

MIT - see [LICENSE](LICENSE) for details.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance58

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

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/eec0a447a6d126149332362ab41223914686cb1645a35d6c1cdfcc6aec865a92?d=identicon)[stuartc842](/maintainers/stuartc842)

### Embed Badge

![Health badge](/badges/flapjackhq-flapjack-search-php/health.svg)

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

###  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.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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