Coder Social home page Coder Social logo

michaeljennings / laralastica Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 7.0 236 KB

A laravel 5 package that adds the ability to search eloquent models using elasticsearch results, it also handles indexing and removing documents when you save or delete models.

License: MIT License

PHP 100.00%
elasticsearch-queries laravel-package

laralastica's People

Contributors

amrsoliman avatar ceesvanegmond avatar georgehanson avatar matthewbdaly avatar michaeljennings avatar threesquared avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laralastica's Issues

Send model updates to multiple indexes

We've got a use case where we'd need to update multiple indexes with the model data.

I'm not sure if we could extend the listener and write our own or do we need to contribute this as PR and you'd accept it.

@michaeljennings how do you think this should go?

Support for Eloquent SoftDeletes trait

Our use case includes updating entries that are already soft-deleted. In such an instance, when attributes change, they should not be communicated to Elasticsearch. The update should rather be ignored.

The goal is for soft-deleted entries to only be found in the database, not in Elasticsearch.

I guess I could hook in this logic myself, but I wonder what would the proper place be? Is there a sensible way to use a custom observer class, so I can override the created() method?

No listeners in Laravel 5.1

I've had some issues with this package in combination with Laravel 5.1.
Because of some ServiceProvider changes.

Default, the ServiceProvider is $defer = true.
This means that all the listeners in the serviceprovider are not being loaded by default.

So for instance, if I want to add all say pages to elastic, i want to do something like this:

<?php

Route::get('/', function() {
    foreach(Page::all() as $page) {
       $page->save();
    }
});

Because the service providers defer is true, the events that are being fired from above piece of code arend handled, because the listeners arent initialized.

When I set the defer to false, above piece of code is working.
What can we do about this?

ElasticSearch 7 support

We are still running 5.x on our production environment, but we will be spending some time on rewriting stuff that is holding us back and will be striving to go up the upgrade tree.

Is there a roadmap/timeline to add support for elasticsearch 7?

Overriding model sync on save

In some cases, we might save a model but not wish to sync it to ES.

For example, if we are updating an attribute that is not indexed, this creates an unnecessary overhead.

Is there a preferred method to achieve this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.