adamfairholm / Elasticquent

Map Larvel Eloquent models to Elasticsearch types
MIT License
201 stars 38 forks source link

Document Search Method Feedback #2

Open adamfairholm opened 10 years ago

adamfairholm commented 10 years ago

Hello all - looking for some feedback on this.

Currently the way Elastiquent works is it uses the indexed source data in your Elasticsearch documents as the population data for your models. The whole idea behind using Elasticsearch is because it's super fast, so this way you are never hitting the database - you are bypassing that and using your indexed data only.

There are limitations to this, obviously - one being that you can only access data you have indexed, so you can't bust out relationships like you would when you are using Eloquent as you normally would. However, you can choose to index certain relationship data in your documents and search on those, allowing you to

So I'm wondering if Elastiquent needs functionality that allows you to hit the full database, using Elasticsearch as basically the search broker. So Elastiquent would search for the term and then do a FIELD query to limit to IDs, allowing you to do whatever you'd like to that query. It's a method that pushes Elasticsearch further back in the process but it may offer an easier path to flexibility for those who need it.

Adam

patrick-radius commented 9 years ago

Yes this would be very helpful but on an opt-in per query basis. So, sometimes the index has all the data the request needs, but other times another data store should be able to augment missing data/relations.

On a side note, I really like how https://github.com/jenssegers/laravel-mongodb allows relations between 'moloquent' models and eloquent models... And I was wondering if you are aware of what the Yii 2.0 team is doing to integrate ES in their ActiveRecord system.

swhammack commented 9 years ago

Just found this package and that is something I would need to see to use this. My application relies on relationships throughout so returning Eloquent model(s) after searching would be necessary. As pradius-fut said above, make it a per query basis , but also have an option to make it the default.

adamfairholm commented 9 years ago

Sounds good - I am going to try and get this in for a 1.1 version in the next few weeks.

ilikourou commented 9 years ago

Hello.

Any progress here?