PHPackages                             waska14/elasticquent - 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. [Database &amp; ORM](/categories/database)
4. /
5. waska14/elasticquent

ActiveLibrary[Database &amp; ORM](/categories/database)

waska14/elasticquent
====================

Maps Laravel Eloquent models to Elasticsearch types. (forked from elasticquent/elasticquent)

v2.0.0(6y ago)14.4k1MITPHPPHP &gt;=5.4.0

Since Oct 22Pushed 6y agoCompare

[ Source](https://github.com/waska14/Elasticquent)[ Packagist](https://packagist.org/packages/waska14/elasticquent)[ Docs](https://github.com/elasticquent/Elasticquent)[ RSS](/packages/waska14-elasticquent/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (6)Versions (10)Used By (0)

Elasticquent
============

[](#elasticquent)

*Elasticsearch for Eloquent Laravel Models*

Elasticquent makes working with [Elasticsearch](http://www.elasticsearch.org/) and [Eloquent](http://laravel.com/docs/eloquent) models easier by mapping them to Elasticsearch types. You can use the default settings or define how Elasticsearch should index and search your Eloquent models right in the model.

Elasticquent uses the [official Elasticsearch PHP API](https://github.com/elasticsearch/elasticsearch-php). To get started, you should have a basic knowledge of how Elasticsearch works (indexes, types, mappings, etc).

Elasticsearch Requirements
==========================

[](#elasticsearch-requirements)

You must be running *at least* Elasticsearch 1.0. Elasticsearch 0.9 and below *will not work* and are not supported.

Contents
--------

[](#contents)

- [Overview](#overview)
    - [How Elasticquent Works](#how-elasticquent-works)
- [Setup](#setup)
    - [Elasticsearch Configuration](#elasticsearch-configuration)
    - [Indexes and Mapping](#indexes-and-mapping)
    - [Setting a Custom Index Name](#setting-a-custom-index-name)
    - [Setting a Custom Type Name](#setting-a-custom-type-name)
- [Indexing Documents](#indexing-documents)
- [Searching](#searching)
    - [Search Collections](#search-collections)
    - [Search Collection Documents](#search-collection-documents)
    - [Chunking results from Elastiquent](#chunking-results-from-elastiquent)
    - [Using the Search Collection Outside of Elasticquent](#using-the-search-collection-outside-of-elasticquent)
- [More Options](#more-options)
    - [Document Ids](#document-ids)
    - [Document Data](#document-data)
    - [Using Elasticquent With Custom Collections](#using-elasticquetn-with-custom-collections)
- [Roadmap](#roadmap)

Reporting Issues
----------------

[](#reporting-issues)

If you do find an issue, please feel free to report it with [GitHub's bug tracker](https://github.com/elasticquent/Elasticquent/issues) for this project.

Alternatively, fork the project and make a pull request :)

Overview
--------

[](#overview)

Elasticquent allows you take an Eloquent model and easily index and search its contents in Elasticsearch.

```
    $books = Book::where('id', '
