GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - algolia/search-bundle: Seamless integration of Algolia Search into your Symfony project.

BranchesTags
Open more actions menu

Latest commit

 

History

699 Commits
699 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
tests
tests
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.php-cs-fixer.dist.php
.php-cs-fixer.dist.php
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
DOCKER_README.MD
DOCKER_README.MD
 
 
Dockerfile
Dockerfile
 
 
LICENCE
LICENCE
 
 
LICENSE
LICENSE
 
 
MAINTAINERS.md
MAINTAINERS.md
 
 
README.md
README.md
 
 
UPGRADE-3.0.md
UPGRADE-3.0.md
 
 
UPGRADE-4.0.md
UPGRADE-4.0.md
 
 
UPGRADE-8.1.md
UPGRADE-8.1.md
 
 
composer.json
composer.json
 
 
coverage-checker.php
coverage-checker.php
 
 
example-search.png
example-search.png
 
 
phpstan.neon.dist
phpstan.neon.dist
 
 
phpunit.xml.dist
phpunit.xml.dist
 
 

Repository files navigation

Algolia for Symfony

The perfect starting point to integrate Algolia within your Symfony project

CI Total Downloads Latest Version License

Documentation • PHP • Laravel • Community Forum • Stack Overflow • Report a bug • FAQ • Support

✨ Features

  • Simple: You can get started with only 5 lines of YAML
  • Robust: Built on top of our PHP Client v4, with waitable responses out of the box
  • Flexible: All methods take optional $requestOptions to let you handle your data as you wish
  • Dev-friendly: Auto-completion and type-hinting thanks to an exhaustive documentation

Algolia SearchBundle requires PHP >= 8.2 and supports Symfony 7 and 8.

💡 Getting Started

First, install Algolia Search Bundle Integration via the composer package manager:

composer require algolia/search-bundle

You will also need to provide the Algolia App ID and Admin API key. By default, they are loaded from environment variables ALGOLIA_APP_ID and ALGOLIA_API_KEY.

If you use .env config file, you can set them there.

ALGOLIA_APP_ID=XXXXXXXXXX
ALGOLIA_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

If you don't use environment variables, you can set them in your parameters.yml.

parameters:
    env(ALGOLIA_APP_ID): XXXXXXXXXX
    env(ALGOLIA_API_KEY): xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Indexing data

First, we need to define which entities should be indexed in Algolia. Each entry under the indices config key must contain at least the 2 following attributes:

  • name is the canonical name of the index in Algolia
  • class is the full name of the entity to index

Example:

algolia_search:
  indices:
    - name: posts
      class: App\Entity\Post

Via CLI

Once your indices config is ready, you can use the built-in console command to batch import all existing data.

# Import all indices
php bin/console search:import

# Choose what indices to reindex by passing the index name
php bin/console search:import --indices=posts,comments

Before re-indexing everything, you may want to clear the index first, see how to remove data.

Simple Search

In this example we'll search for posts. The search method will query Algolia to get matching results and then will create a doctrine collection. The data are pulled from the database (that's why you need to pass the Doctrine Manager).

$posts = $this->searchService->search($entityManager, Post::class, 'query');

For full documentation, visit the Algolia Symfony Search Bundle.

Troubleshooting

Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the bundle.

Use the Dockerfile

If you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check our dedicated guide to learn more.

📄 License

Algolia Symfony Search Bundle is an open-sourced software licensed under the MIT license.

About

Seamless integration of Algolia Search into your Symfony project.

Resources

Readme

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

195 stars

Watchers

73 watching

Forks

74 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.