2017 © Pedro Peláez
 

symfony-bundle search-bundle

image

algolia/search-bundle

  • Saturday, July 14, 2018
  • by julienbourdeau
  • Repository
  • 56 Watchers
  • 114 Stars
  • 20,629 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 43 Forks
  • 19 Open issues
  • 48 Versions
  • 110 % Grown

The README.md

Algolia for Symfony , (*1)

The perfect starting point to integrate Algolia within your Symfony project

CircleCI Total Downloads Latest Version License , (*2)

DocumentationPHPLaravelCommunity ForumStack OverflowReport a bugFAQSupport , (*3)

✨ Features

  • Simple: You can get started with only 5 lines of YAML
  • Robust: It benefits from all the new features of our PHP Client v2, like the wait() method
  • 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 supports PHP > 7.1, (*4)

💡 Getting Started

First, install Algolia Search Bundle Integration via the composer package manager:, (*5)

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., (*6)

If you use .env config file, you can set them there., (*7)

ALGOLIA_APP_ID=XXXXXXXXXX
ALGOLIA_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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

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:, (*9)

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

Example:, (*10)

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., (*11)

# 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., (*12)

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)., (*13)

$em = $this->getDoctrine()->getManagerForClass(Post::class);

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

For full documentation, visit the Algolia Symfony Search Bundle., (*14)

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., (*15)

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., (*16)

📄 License

Algolia Symfony Search Bundle is an open-sourced software licensed under the MIT license., (*17)

The Versions

23/10 2017

dev-alcaeus-fix-discriminated-entity-discovery

dev-alcaeus-fix-discriminated-entity-discovery

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

18/10 2017

dev-gruberro-allow-skipping-non-algolia-entities

dev-gruberro-allow-skipping-non-algolia-entities

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

18/10 2017

dev-fix/cleanup-tests

dev-fix/cleanup-tests

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

18/10 2017

2.x-dev

2.9999999.9999999.9999999-dev

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

18/10 2017

dev-AlessandroMinoccheri-little_improvements

dev-AlessandroMinoccheri-little_improvements

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

10/10 2017

dev-alcaeus-test-php-7.2

dev-alcaeus-test-php-7.2

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

10/04 2017

dev-alcaeus-skip-delete-embedded-documents

dev-alcaeus-skip-delete-embedded-documents

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

04/04 2017

dev-poc/skip-non-algolia-entities

dev-poc/skip-non-algolia-entities

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

27/03 2017

2.2.0

2.2.0.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

04/01 2017

2.1.0

2.1.0.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

08/08 2016

2.0.0

2.0.0.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

08/02 2016

1.0.13

1.0.13.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

29/01 2016

1.0.12

1.0.12.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

06/01 2016

1.0.11

1.0.11.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

07/12 2015

1.0.10

1.0.10.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

03/12 2015

1.0.9

1.0.9.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

14/08 2015

1.0.8

1.0.8.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

23/07 2015

1.0.7

1.0.7.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

20/07 2015

1.0.6

1.0.6.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

20/07 2015

1.0.5

1.0.5.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

09/07 2015

1.0.4

1.0.4.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

22/06 2015

1.0.3

1.0.3.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

14/05 2015

1.0.2

1.0.2.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

MIT

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

28/03 2015

dev-mongo

dev-mongo

Seamless integration from Algolia Search into your Symfony with Doctrine project.

  Sources   Download

The Requires

 

The Development Requires

by François-Marie de Jouvencel

09/02 2015

1.0.1

1.0.1.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team

12/01 2015

1.0.0

1.0.0.0

Seamless integration of Algolia Search into your Symfony project.

  Sources   Download

The Requires

 

The Development Requires

by François-Marie de Jouvencel
by Algolia Team