Request for Elasticsearch-rails fork

Hi, is there any chance of a fork for elasticsearch-rails (GitHub - elastic/elasticsearch-rails: Elasticsearch integrations for ActiveModel/Record and Ruby o) with the new client libraries?

It looks to be built using the same underlying gems as elasticsearch-ruby which was on the list of libraries intended to be forked, but offers a lot of nice benefits to Rails applications specifically.

Thanks

1 Like

Hey Sam! That’s a good question. It’s not currently on the list that I’ve seen, but that doesn’t mean things are settled.

Let me turn this around since I’m not super involved in Ruby or rails.

  • What does this block for you?
  • Is there another way to utilize the existing rails library with opensearch-ruby? (e.g. can you pass in an alternate client library)

Thanks for getting back to me. Those are also great questions, I opened this thread on behalf of the company I work for as we currently use elasticsearch-rails, but I don’t maintain that part of our app so I don’t think I’m best placed to answer them.

I’ve asked a couple of my colleagues who work on that area and know a lot more about elasticsearch than I to share their thoughts here, they should get back to you shortly after the weekend.

Thanks again

1 Like

Elasticsearch Rails is split into two parts
elasticsearch-rails which provides some instrumentation such as nice logging the time that queries took. It also adds some nice rake task (which are dependent on elasticsearch-model) but neither of these are essential

elasticsearch-model provides some nice abstractions for us

  • Adds callbacks for model indexing
  • easy importing of models into ES
  • set up an indexes and there mappings in ruby
  • multi model search
  • set index name and document type
  • paginatation of results

However it does allow us to configure a client elasticsearch-rails/elasticsearch-model at master · elastic/elasticsearch-rails · GitHub if your version of elasticsearch-ruby follows the same api i wonder if we could drop this in here?

If this isnt possible, it will mean that we will have to re write all this stuff as out of the box elasticsearch ruby is just a client for ES which would be quite an overhead for us as currently we have a working implementation.

2 Likes

In theory, If you can configure a client, I think you could drop in the OpenSearch client - all these forks are supposed to be syntax compatible if the language allows.

However, if that’s controlled by Elastic it might just be a matter of time before dropping in an OpenSearch client is blocked.

1 Like

Yeah, that is my fear… it is outside of our control and they are taking steps to stop their stuff working with opensearch.

Here is the good news about this particular library - it’s slow moving. Many of the other client libraries for Elasticsearch use lock-step versioning - Elasticsearch Version === Client Library version. This one doesn’t seem to work that way.

Net/net: Should there be a specific block put into place it would give the community time to react accordingly and the existing versions will still be fine.

Sounds good. Thanks for you help investigating this. Look forward to testing the new opensearch ruby library with this library

1 Like