Searchkick search without ActiveRecord models - ruby-on-rails

I have a classic Ruby on Rails application that has the ActiveRecord models and Searchkick to create a search index. I want to create a second API Ruby on Rails application, without models, so that I can search through the Opensearch/Elasticsearch index without having ActiveRecord.
Can I use Searchkick, without database models, getting data from the search index?
I would be grateful if you could show examples. Thank you in advance for your cooperation.

Related

How to back Ruby on Rails models to only ElasticSearch

I have been looking for a while and could not find information about how to create a Ruby on Rails application that uses just ElasticSearch as a backend.
Can anyone show me the way to use the ElasticSearch gems available to back a model in a ruby on rails application to only ElasticSearch?
All of the solutions I find involve backing data to a relational database like MySQL and then updating ElasticSearch on callbacks/hooks. I was trying to avoid having the data in two places, would like all data to live in ElasticSearch.
I envisions something like this:
class Person < ElasticSearch::ActiveRecord::Base
end
Where ElasticSearch::ActiveRecord::Base will back the model to ElasticSearch.

Rails 5 Search Facets Filters

I would like to add the ability to filter records using facets. I know Elastic Search can help with it, but I don't want to setup an elastic search server. I am looking for a really easy solution. I would like to have the search and facets filters run on Postgres and Ruby on Rails 5. Any recommendations?
If you don't want to setup ElasticSearch/Solr server,
FortyFacets appears to be a very good option. It lets you easily build faceted search based on fields of your models (see Active Record model pattern).

ActiveAdmin without ActiveRecord

Is there a way to make ActiveAdmin show information from a resource that isn't a database?
I have a model that's instantiated from JSON received remotely. I would like to get ActiveAdmin to show this information.
If I seed the database, ActiveAdmin will show the same number of records that I have in the seed file. When I comment out the seed, it shows nothing.
Yes, but you will have to change ActiveAdmin code, and will not be trivial.
Active admin depends on rails which depends on active record.
It also extensively use active record features on the code.
The best path to go is to write a db adapter for Rails using your API. There is one question here that addresses how to create a DB adapter.

Rails Active Resource with sunspot solr

Hello i"m trying to implement an app which draws its contents via Active Resource, but i'd like to be able to search these contents. is it possible to use sunspot solr with active resource?
Yes. Follow the approach outlined on my blog at http://www.chandranshu.com/sunspot-with-activeresource/ .
The critical part is to create an InstanceAdapter and a DataAccessor and include them into your ActiveResource model. Rest all you can figure out from the errors that you get.

How to generate documentation for models in rails application?

I want to generate documentation for my rails application. The application has models with relationship(e.g. has_many relation) and I am looking for a way to generate documentation that shows the relation between models. Ideally, with some graphs those represent the relationships between models.
Is there a way to achieve this in rails 3.2x ?
Check out the rails-erd gem. It generates entity-relationship diagrams from your models.
The Rubymine IDE also does it on the fly, but it's not free.

Resources