Download the PHP package japseyz/algoliasearch-laravel without Composer

On this page you can find all versions of the php package japseyz/algoliasearch-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package algoliasearch-laravel

Laravel Algolia Search

This PHP package integrates the Algolia Search API to the Laravel Eloquent ORM. It's based on the algoliasearch-client-php package. PHP 5.5.9+ is supported.

Build Status Latest Version License

Note: If you're using Laravel 4, checkout the algoliasearch-laravel-4 repository.

Table of Content

  1. Install
  2. Configuration
  3. Quick Start
  4. Ranking & Relevance
  5. Options
  6. Indexing
  7. Master/Slave
  8. Target multiple indexes

Install

Add algolia/algoliasearch-laravel to your composer.json file:

Add the service provider to config/app.php in the providers array.

Configuration

Laravel Algolia requires a connection configuration. To get started, you'll need to publish all vendor assets:

You can add the option to only publish assets of the Algolia package.

This will create a config/algolia.php file in your app that you can modify to set your configuration. Also, make sure you check for changes compared to the original config file after an upgrade.

Quick Start

The following code adds search capabilities to your Contact model creating a Contact index:

By default all visible attributes are sent. If you want to send specific attributes you can do something like:

Ranking & Relevance

We provide many ways to configure your index settings to tune the overall relevancy but the most important ones are the searchable attributes and the attributes reflecting the record popularity. You can configure them with the following code:

You can propagate (save) the settings to algolia using the setSetting method:

Frontend Search (realtime experience)

Traditional search implementations tend to have search logic and functionality on the backend. This made sense when the search experience consisted of a user entering a search query, executing that search, and then being redirected to a search result page.

Implementing search on the backend is no longer necessary. In fact, in most cases it is harmful to performance because of the extra network and processing latency. We highly recommend the usage of our JavaScript API Client issuing all search requests directly from the end user's browser, mobile device, or client. It will reduce the overall search latency while offloading your servers at the same time.

In your JavaScript code you can do:

Backend Search

You could also use the search method but it's not recommended to implement instant/realtime search experience:

Options

Auto-indexing & Asynchronism

Each time a record is saved; it will be - asynchronously - indexed. On the other hand, each time a record is destroyed, it will be - asynchronously - removed from the index.

You can disable the auto-indexing and auto-removing setting the following options:

You can temporary disable auto-indexing. This is often used for performance reason.

Custom Index Name

By default, the index name will be the pluralized class name, e.g. "Contacts". You can customize the index name by using the $indices option:

Per-environment Indexes

You can suffix the index name with the current App environment using the following option:

Custom objectID

By default, the objectID is based on your record's keyName (id by default). You can change this behavior specifying the objectIdKey option (be sure to use a uniq field).

Restrict Indexing to a Subset of Your Data

You can add constraints controlling if a record must be indexed by defining the indexOnly() method.

Relationships

By default the Algolia package will fetch the loaded relationships.

If you want to index records that didn't yet load any relations you can do it by loading them in the that you can create in your model.

It will look like:

In the resulted object you will have categories converted to array by Laravel. If you want a custom relation structure you will instead do something like :

Indexing

Manual Indexing

You can trigger indexing using the pushToIndex instance method.

Manual Removal

And trigger the removing using the removeFromIndex instance method.

Reindexing

To safely reindex all your records (index to a temporary index + move the temporary index to the current one atomically), use the reindex class method:

To reindex all your records (in place, without deleting out-dated records):

Clearing an Index

To clear an index, use the clearIndices class method:

Master/Slave

You can define slave indexes using the $algolia_settings variable:

To search using a slave use the following code:

Target Multiple Indexes

You can index a record in several indexes using the $indices property:

To search using an extra index, use the following code:

Eloquent compatibility

Doing :

will not trigger anything in the model (so no update will happen in Algolia). This is because this is not an Eloquent call, it is just a convenient way to generate the query hidden behind the model

To make this query work with Algolia you need to do it like that:

Compatibility

Compatible with 5.x applications

License

Laravel Algolia Search is licensed under The MIT License (MIT).


All versions of algoliasearch-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
vinkla/algolia Version ~2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package japseyz/algoliasearch-laravel contains the following files

Loading the files please wait ....