Skip to content

ES as primary data store #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xinuc opened this issue Mar 26, 2014 · 10 comments
Closed

ES as primary data store #60

xinuc opened this issue Mar 26, 2014 · 10 comments
Labels

Comments

@xinuc
Copy link

xinuc commented Mar 26, 2014

Is it possible right now to use this gem to create rails model using only ES?

e.g:

class Article
  include Elasticsearch::Model
  mappings do
    indexes :title
    indexes :body
  end

end

a = Article.new title: "hello", body: "hello body"
a.save

If so, is there any documentation about this?

Thanks.

@karmi
Copy link
Contributor

karmi commented Mar 27, 2014

I've started work on the "persistence" layer for this, it's not yet finished, ETA in couple of weeks. There's a discussion in #4.

@karmi karmi added the waiting label Mar 27, 2014
@xinuc
Copy link
Author

xinuc commented Mar 28, 2014

Great!

@karmi
Copy link
Contributor

karmi commented Apr 4, 2014

The working version of the repository pattern implementation added in #71.

@xinuc
Copy link
Author

xinuc commented Apr 6, 2014

Great work there!

A question though, what is the use case for each pattern?
Should I use the Repository pattern? (the API doesn't quite feel right for me),
or should I wait for the ActiveRecord pattern?

I really wish the DSL mimics something like mongoid's.

@karmi
Copy link
Contributor

karmi commented Apr 6, 2014

The notation you have originally described is indeed typical for the ActiveRecord-like patterns. That is not yet implemented, so if you want to do that, you have to wait for it to be coded (should be released in couple of weeks).

@xinuc
Copy link
Author

xinuc commented Apr 6, 2014

Thanks.

Is the ActiveRecord pattern implemented on top of the Repository Pattern?

I still don't understand the use case of the Repository Pattern.

@xinuc
Copy link
Author

xinuc commented Apr 6, 2014

Ah, one more thing.

Will the AR like pattern use ActiveModel and works seamlessly with form helper etc?

Thanks.

@karmi
Copy link
Contributor

karmi commented Apr 6, 2014

Yes, that's the main motivation, to be a drop-in replacement for ActiveRecord::Base based models.

@pepe
Copy link
Contributor

pepe commented Apr 10, 2014

This look really nice, thank you!

@karmi
Copy link
Contributor

karmi commented Apr 17, 2014

Closing this, let's centralize the discussion in #78.

@karmi karmi closed this as completed Apr 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants